summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/windows
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-11-27 22:47:59 +0000
committerBrian Paul <[email protected]>2004-11-27 22:47:59 +0000
commit65a66f5bc37383c00423c21baf8ba9d6771e0259 (patch)
tree0d98e004b457adde579dd27b9fe32182d54268b6 /src/mesa/drivers/windows
parent118a8bad73bda88fc54f802b2beeb687c8ddb45a (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.c18
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 acd5f4a34fb..5d7e260c4b6 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);
}