summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/windows
diff options
context:
space:
mode:
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 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);
}