From 65a66f5bc37383c00423c21baf8ba9d6771e0259 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 27 Nov 2004 22:47:59 +0000 Subject: 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. --- src/mesa/drivers/ggi/ggimesa.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/mesa/drivers/ggi/ggimesa.c') diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c index cb34c1a541..0652d76248 100644 --- a/src/mesa/drivers/ggi/ggimesa.c +++ b/src/mesa/drivers/ggi/ggimesa.c @@ -30,6 +30,7 @@ #include #include #include "extensions.h" +#include "buffers.h" #include "colormac.h" #include "imports.h" #include "matrix.h" @@ -256,6 +257,13 @@ static void gl_ggiGetSize(GLframebuffer *fb, GLuint *width, GLuint *height) printf("returning %d, %d\n", *width, *height); } +static void gl_ggiViewport(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(); +} + + static void gl_ggiSetIndex(GLcontext *ctx, GLuint ci) { ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; @@ -400,6 +408,7 @@ static void gl_ggiSetupPointers(GLcontext *ctx) /* General information */ ctx->Driver.GetString = gl_ggiGetString; ctx->Driver.GetBufferSize = gl_ggiGetSize; + ctx->Driver.Viewport = gl_ggiViewport; ctx->Driver.Finish = gl_ggiFlush; ctx->Driver.Flush = gl_ggiFlush; @@ -632,15 +641,6 @@ void ggiMesaMakeCurrent(ggi_mesa_context_t ctx, ggi_visual_t vis) } _mesa_make_current(ctx->gl_ctx, &LIBGGI_MESAEXT(vis)->mesa_buffer); - - if (ctx->gl_ctx->Viewport.Width == 0) - { - _mesa_Viewport(0, 0, - LIBGGI_VIRTX(vis), - LIBGGI_VIRTY(vis)); - ctx->gl_ctx->Scissor.Width = LIBGGI_VIRTX(vis); - ctx->gl_ctx->Scissor.Height = LIBGGI_VIRTY(vis); - } } -- cgit v1.2.3