Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenscissor.c
Go to the documentation of this file.
00001 /* 00002 * Mesa 3-D graphics library 00003 * Version: 7.1 00004 * 00005 * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. 00006 * 00007 * Permission is hereby granted, free of charge, to any person obtaining a 00008 * copy of this software and associated documentation files (the "Software"), 00009 * to deal in the Software without restriction, including without limitation 00010 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00011 * and/or sell copies of the Software, and to permit persons to whom the 00012 * Software is furnished to do so, subject to the following conditions: 00013 * 00014 * The above copyright notice and this permission notice shall be included 00015 * in all copies or substantial portions of the Software. 00016 * 00017 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00018 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00019 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00020 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00021 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00022 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00023 */ 00024 00025 00026 #include "main/glheader.h" 00027 #include "main/context.h" 00028 #include "main/scissor.h" 00029 00030 00034 void GLAPIENTRY 00035 _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ) 00036 { 00037 GET_CURRENT_CONTEXT(ctx); 00038 ASSERT_OUTSIDE_BEGIN_END(ctx); 00039 00040 if (width < 0 || height < 0) { 00041 _mesa_error( ctx, GL_INVALID_VALUE, "glScissor" ); 00042 return; 00043 } 00044 00045 if (MESA_VERBOSE & VERBOSE_API) 00046 _mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height); 00047 00048 _mesa_set_scissor(ctx, x, y, width, height); 00049 } 00050 00051 00065 void 00066 _mesa_set_scissor(GLcontext *ctx, 00067 GLint x, GLint y, GLsizei width, GLsizei height) 00068 { 00069 if (x == ctx->Scissor.X && 00070 y == ctx->Scissor.Y && 00071 width == ctx->Scissor.Width && 00072 height == ctx->Scissor.Height) 00073 return; 00074 00075 FLUSH_VERTICES(ctx, _NEW_SCISSOR); 00076 ctx->Scissor.X = x; 00077 ctx->Scissor.Y = y; 00078 ctx->Scissor.Width = width; 00079 ctx->Scissor.Height = height; 00080 00081 if (ctx->Driver.Scissor) 00082 ctx->Driver.Scissor( ctx, x, y, width, height ); 00083 } 00084 00085 00090 void 00091 _mesa_init_scissor(GLcontext *ctx) 00092 { 00093 /* Scissor group */ 00094 ctx->Scissor.Enabled = GL_FALSE; 00095 ctx->Scissor.X = 0; 00096 ctx->Scissor.Y = 0; 00097 ctx->Scissor.Width = 0; 00098 ctx->Scissor.Height = 0; 00099 } Generated on Mon May 28 2012 04:20:08 for ReactOS by
1.7.6.1
|