Changeset 3598 for trunk/src/opengl/mesa/scissor.c
- Timestamp:
- May 23, 2000, 10:41:28 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/scissor.c
r2962 r3598 1 /* $Id: scissor.c,v 1. 2 2000-03-01 18:49:35jeroen Exp $ */1 /* $Id: scissor.c,v 1.3 2000-05-23 20:40:53 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 33 33 #include "all.h" 34 34 #else 35 #ifndef XFree86Server 36 #include <stdio.h> 37 #else 38 #include "GL/xf86glx.h" 39 #endif 35 #include "glheader.h" 40 36 #include "types.h" 41 37 #include "context.h" … … 45 41 46 42 47 void gl_Scissor( GLcontext *ctx,48 43 void 44 _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ) 49 45 { 50 if (width<0 || height<0) { 46 GET_CURRENT_CONTEXT(ctx); 47 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glScissor"); 48 49 if (width < 0 || height < 0) { 51 50 gl_error( ctx, GL_INVALID_VALUE, "glScissor" ); 52 51 return; 53 52 } 54 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBegin");55 53 56 54 if (MESA_VERBOSE & VERBOSE_API) 57 55 fprintf(stderr, "glScissor %d %d %d %d\n", x, y, width, height); 58 56 59 if (x!=ctx->Scissor.X || y!=ctx->Scissor.Y || 60 width!=ctx->Scissor.Width || height!=ctx->Scissor.Height) { 57 if (x != ctx->Scissor.X || 58 y != ctx->Scissor.Y || 59 width != ctx->Scissor.Width || 60 height != ctx->Scissor.Height) { 61 61 ctx->Scissor.X = x; 62 62 ctx->Scissor.Y = y; … … 81 81 { 82 82 /* first check if whole span is outside the scissor box */ 83 if (y<ctx->Buffer->Ymin || y>ctx->Buffer->Ymax 84 || x>ctx->Buffer->Xmax || x+(GLint)n-1<ctx->Buffer->Xmin) { 83 if (y < ctx->DrawBuffer->Ymin 84 || y > ctx->DrawBuffer->Ymax 85 || x > ctx->DrawBuffer->Xmax 86 || x + (GLint) n - 1 < ctx->DrawBuffer->Xmin) { 85 87 return 0; 86 88 } 87 89 else { 90 const GLint xMin = ctx->DrawBuffer->Xmin; 91 const GLint xMax = ctx->DrawBuffer->Xmax; 88 92 GLint i; 89 GLint xMin = ctx->Buffer->Xmin; 90 GLint xMax = ctx->Buffer->Xmax; 91 for (i=0; x+i < xMin; i++) { 93 for (i = 0; x + i < xMin; i++) { 92 94 mask[i] = 0; 93 95 } 94 for (i =(GLint)n-1; x+i > xMax; i--) {96 for (i = (GLint) n - 1; x + i > xMax; i--) { 95 97 mask[i] = 0; 96 98 } … … 110 112 GLubyte mask[] ) 111 113 { 112 GLint xmin = ctx->Buffer->Xmin;113 GLint xmax = ctx->Buffer->Xmax;114 GLint ymin = ctx->Buffer->Ymin;115 GLint ymax = ctx->Buffer->Ymax;114 const GLint xmin = ctx->DrawBuffer->Xmin; 115 const GLint xmax = ctx->DrawBuffer->Xmax; 116 const GLint ymin = ctx->DrawBuffer->Ymin; 117 const GLint ymax = ctx->DrawBuffer->Ymax; 116 118 GLuint i; 117 119
Note:
See TracChangeset
for help on using the changeset viewer.