diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2004-11-27 22:47:59 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2004-11-27 22:47:59 +0000 |
commit | 65a66f5bc37383c00423c21baf8ba9d6771e0259 (patch) | |
tree | 0d98e004b457adde579dd27b9fe32182d54268b6 /src/mesa/drivers/windows | |
parent | 118a8bad73bda88fc54f802b2beeb687c8ddb45a (diff) |
Remove _mesa_ResizeBuffersMESA() call from _mesa_set_viewport().
Now, the driver's Viewport routine should call _mesa_ResizeBuffersMESA()
if necessary.
Cleaned up code related to GLframebuffer width/height initialization.
Set initial viewport/scissor params in _mesa_make_current2(), instead of
in the drivers' MakeCurrent functions.
Diffstat (limited to 'src/mesa/drivers/windows')
-rw-r--r-- | src/mesa/drivers/windows/gdi/wmesa.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index acd5f4a34f..5d7e260c4b 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -29,6 +29,7 @@ //#include "mesa_extend.h" #include "glheader.h" +#include "buffers.h" #include "colors.h" #include "context.h" #include "colormac.h" @@ -614,7 +615,7 @@ static void set_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, /* Return characteristics of the output buffer. */ -static void buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) +static void get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) { /*GET_CURRENT_CONTEXT(ctx);*/ int New_Size; @@ -658,6 +659,12 @@ static void buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) } +static void viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) +{ + /* poll for window size change and realloc software Z/stencil/etc if needed */ + _mesa_ResizeBuffersMESA(); +} + /**********************************************************************/ /***** Accelerated point, line, polygon rendering *****/ @@ -1094,7 +1101,8 @@ static void SetFunctionPointers( struct dd_function_table *functions ) functions->GetString = get_string; functions->UpdateState = wmesa_update_state; functions->ResizeBuffers = _swrast_alloc_buffers; - functions->GetBufferSize = buffer_size; + functions->GetBufferSize = get_buffer_size; + functions->Viewport = viewport; functions->Clear = clear; @@ -1491,12 +1499,6 @@ void WMesaMakeCurrent( WMesaContext c ) Current = c; wmesa_update_state(c->gl_ctx, 0); _mesa_make_current(c->gl_ctx, c->gl_buffer); - if (Current->gl_ctx->Viewport.Width==0) { - /* initialize viewport to window size */ - _mesa_Viewport( 0, 0, Current->width, Current->height ); - Current->gl_ctx->Scissor.Width = Current->width; - Current->gl_ctx->Scissor.Height = Current->height; - } if ((c->cColorBits <= 8 ) && (c->rgb_flag == GL_TRUE)){ WMesaPaletteChange(c->hPalHalfTone); } |