diff options
author | Brian Paul <[email protected]> | 2004-11-27 22:47:59 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-11-27 22:47:59 +0000 |
commit | 65a66f5bc37383c00423c21baf8ba9d6771e0259 (patch) | |
tree | 0d98e004b457adde579dd27b9fe32182d54268b6 /src/mesa/drivers/ggi | |
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/ggi')
-rw-r--r-- | src/mesa/drivers/ggi/ggimesa.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c index cb34c1a5410..0652d762487 100644 --- a/src/mesa/drivers/ggi/ggimesa.c +++ b/src/mesa/drivers/ggi/ggimesa.c @@ -30,6 +30,7 @@ #include <ggi/mesa/ggimesa_int.h> #include <ggi/mesa/debug.h> #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); - } } |