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/glide | |
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/glide')
-rw-r--r-- | src/mesa/drivers/glide/fxapi.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxdd.c | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index 708dad51f41..a96709c4fa2 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -873,10 +873,6 @@ fxMesaMakeCurrent(fxMesaContext fxMesa) _mesa_make_current(fxMesa->glCtx, fxMesa->glBuffer); fxSetupDDPointers(fxMesa->glCtx); - - /* The first time we call MakeCurrent we set the initial viewport size */ - if (fxMesa->glCtx->Viewport.Width == 0) - _mesa_set_viewport(fxMesa->glCtx, 0, 0, fxMesa->width, fxMesa->height); } diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index a54bf8fb9c9..e222db951d2 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -43,6 +43,7 @@ #include "image.h" #include "mtypes.h" #include "fxdrv.h" +#include "buffers.h" #include "enums.h" #include "extensions.h" #include "macros.h" @@ -106,7 +107,7 @@ static void fxDisableColor (fxMesaContext fxMesa) /* Return buffer size information */ static void -fxDDBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) +fxDDGetBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) { GET_CURRENT_CONTEXT(ctx); if (ctx && FX_CONTEXT(ctx)) { @@ -121,6 +122,12 @@ fxDDBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) } } +static void +fxDDViewport(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(); +} /* Implements glClearColor() */ static void @@ -2106,7 +2113,8 @@ fxSetupDDPointers(GLcontext * ctx) ctx->Driver.ClearColor = fxDDClearColor; ctx->Driver.Clear = fxDDClear; ctx->Driver.DrawBuffer = fxDDSetDrawBuffer; - ctx->Driver.GetBufferSize = fxDDBufferSize; + ctx->Driver.GetBufferSize = fxDDGetBufferSize; + ctx->Driver.Viewport = fxDDViewport; switch (fxMesa->colDepth) { case 15: ctx->Driver.DrawPixels = fxDDDrawPixels555; |