summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/buffers.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-06-18 17:26:08 +0000
committerBrian Paul <[email protected]>2001-06-18 17:26:08 +0000
commit1b258989462e907e45abbdf8743b0a75f22c02b3 (patch)
treeaaf3847b0189aa370616fbd571a1650d13f1d145 /src/mesa/main/buffers.c
parent24ae7c4c1f18c3086a779a2ee8f480ee5f4e7612 (diff)
Consolidated source files. Since the re-org a number of source files
only had one or two functions left in them.
Diffstat (limited to 'src/mesa/main/buffers.c')
-rw-r--r--src/mesa/main/buffers.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 82afb401a82..075cc66adf2 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -1,4 +1,4 @@
-/* $Id: buffers.c,v 1.29 2001/05/29 15:23:48 brianp Exp $ */
+/* $Id: buffers.c,v 1.30 2001/06/18 17:26:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -36,7 +36,6 @@
#include "depth.h"
#include "enums.h"
#include "macros.h"
-#include "masking.h"
#include "mem.h"
#include "stencil.h"
#include "state.h"
@@ -372,6 +371,37 @@ _mesa_ResizeBuffersMESA( void )
}
+void
+_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (width < 0 || height < 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glScissor" );
+ return;
+ }
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ fprintf(stderr, "glScissor %d %d %d %d\n", x, y, width, height);
+
+ if (x == ctx->Scissor.X &&
+ y == ctx->Scissor.Y &&
+ width == ctx->Scissor.Width &&
+ height == ctx->Scissor.Height)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_SCISSOR);
+ ctx->Scissor.X = x;
+ ctx->Scissor.Y = y;
+ ctx->Scissor.Width = width;
+ ctx->Scissor.Height = height;
+
+ if (ctx->Driver.Scissor)
+ ctx->Driver.Scissor( ctx, x, y, width, height );
+}
+
+
/*
* XXX move somewhere else someday?
*/