diff options
author | Brian Paul <[email protected]> | 2002-03-16 00:53:15 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2002-03-16 00:53:15 +0000 |
commit | 18a285a5e244b7405b85feb7315a30d99920ec5d (patch) | |
tree | 02fbfa95292ef56eef26bb2e8456f65cf1348f18 /src/mesa/swrast/s_accum.c | |
parent | 8d687e7e58a148f3f16573636023e54755372010 (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_accum.c')
-rw-r--r-- | src/mesa/swrast/s_accum.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index 167a655f33b..faf8313d4d1 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -1,4 +1,4 @@ -/* $Id: s_accum.c,v 1.14 2002/02/02 17:24:11 brianp Exp $ */ +/* $Id: s_accum.c,v 1.15 2002/03/16 00:53:15 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -67,38 +67,38 @@ #endif - void -_mesa_alloc_accum_buffer( GLcontext *ctx ) +_mesa_alloc_accum_buffer( GLframebuffer *buffer ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); + GET_CURRENT_CONTEXT(ctx); GLint n; - if (ctx->DrawBuffer->Accum) { - FREE( ctx->DrawBuffer->Accum ); - ctx->DrawBuffer->Accum = NULL; + if (buffer->Accum) { + FREE( buffer->Accum ); + buffer->Accum = NULL; } /* allocate accumulation buffer if not already present */ - n = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height * 4 * sizeof(GLaccum); - ctx->DrawBuffer->Accum = (GLaccum *) MALLOC( n ); - if (!ctx->DrawBuffer->Accum) { + n = buffer->Width * buffer->Height * 4 * sizeof(GLaccum); + buffer->Accum = (GLaccum *) MALLOC( n ); + if (!buffer->Accum) { /* unable to setup accumulation buffer */ - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glAccum" ); + _mesa_error( NULL, GL_OUT_OF_MEMORY, "glAccum" ); } + + if (ctx) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); + /* XXX these fields should probably be in the GLframebuffer */ #ifdef USE_OPTIMIZED_ACCUM - swrast->_IntegerAccumMode = GL_TRUE; + swrast->_IntegerAccumMode = GL_TRUE; #else - swrast->_IntegerAccumMode = GL_FALSE; + swrast->_IntegerAccumMode = GL_FALSE; #endif - swrast->_IntegerAccumScaler = 0.0; + swrast->_IntegerAccumScaler = 0.0; + } } - - - - /* * This is called when we fall out of optimized/unscaled accum buffer mode. * That is, we convert each unscaled accum buffer value into a scaled value |