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/glide/fxapi.c | 4 ---- src/mesa/drivers/glide/fxdd.c | 12 ++++++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/mesa/drivers/glide') diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index 708dad51f4..a96709c4fa 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 a54bf8fb9c..e222db951d 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; -- cgit v1.2.3