summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_stencil.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-03-16 00:53:15 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-03-16 00:53:15 +0000
commit18a285a5e244b7405b85feb7315a30d99920ec5d (patch)
tree02fbfa95292ef56eef26bb2e8456f65cf1348f18 /src/mesa/swrast/s_stencil.c
parent8d687e7e58a148f3f16573636023e54755372010 (diff)
Lots of changes related to framebuffer/window buffer resizing. Basically,
instead of passing a GLcontext* to ResizeBuffers(), pass a GLframebuffer*. The idea is that a window can be resized without it being bound to a rendering context. This makes for a nice clean-up in the XFree86 server-side GLX code. Renamed ctx->Driver.ResizeBuffersMESA() to ctx->Driver.ResizeBuffers().
Diffstat (limited to 'src/mesa/swrast/s_stencil.c')
-rw-r--r--src/mesa/swrast/s_stencil.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index dd438e8dcb..6d62b65fd5 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -1,4 +1,4 @@
-/* $Id: s_stencil.c,v 1.20 2002/02/04 15:59:30 brianp Exp $ */
+/* $Id: s_stencil.c,v 1.21 2002/03/16 00:53:15 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1112,22 +1112,20 @@ _mesa_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y,
* deallocated first. The new stencil buffer will be uninitialized.
*/
void
-_mesa_alloc_stencil_buffer( GLcontext *ctx )
+_mesa_alloc_stencil_buffer( GLframebuffer *buffer )
{
- GLuint buffersize = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height;
-
/* deallocate current stencil buffer if present */
- if (ctx->DrawBuffer->Stencil) {
- FREE(ctx->DrawBuffer->Stencil);
- ctx->DrawBuffer->Stencil = NULL;
+ if (buffer->Stencil) {
+ FREE(buffer->Stencil);
+ buffer->Stencil = NULL;
}
/* allocate new stencil buffer */
- ctx->DrawBuffer->Stencil = (GLstencil *) MALLOC(buffersize * sizeof(GLstencil));
- if (!ctx->DrawBuffer->Stencil) {
+ buffer->Stencil = (GLstencil *) MALLOC(buffer->Width * buffer->Height
+ * sizeof(GLstencil));
+ if (!buffer->Stencil) {
/* out of memory */
-/* _mesa_set_enable( ctx, GL_STENCIL_TEST, GL_FALSE ); */
- _mesa_error( ctx, GL_OUT_OF_MEMORY, "_mesa_alloc_stencil_buffer" );
+ _mesa_error( NULL, GL_OUT_OF_MEMORY, "_mesa_alloc_stencil_buffer" );
}
}