summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dos
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-11-27 22:47:59 +0000
committerBrian Paul <[email protected]>2004-11-27 22:47:59 +0000
commit65a66f5bc37383c00423c21baf8ba9d6771e0259 (patch)
tree0d98e004b457adde579dd27b9fe32182d54268b6 /src/mesa/drivers/dos
parent118a8bad73bda88fc54f802b2beeb687c8ddb45a (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/dos')
-rw-r--r--src/mesa/drivers/dos/dmesa.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c
index 41e0f4d8b31..e0b2cf52b14 100644
--- a/src/mesa/drivers/dos/dmesa.c
+++ b/src/mesa/drivers/dos/dmesa.c
@@ -36,6 +36,7 @@
#include "imports.h"
#ifndef FX
#include "bufferobj.h"
+#include "buffers.h"
#include "extensions.h"
#include "macros.h"
#include "matrix.h"
@@ -812,6 +813,14 @@ get_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();
+}
+
+
static const GLubyte *
get_string (GLcontext *ctx, GLenum name)
{
@@ -898,6 +907,7 @@ dmesa_init_driver_functions (DMesaVisual visual,
driver->UpdateState = dmesa_update_state;
driver->GetString = get_string;
driver->GetBufferSize = get_buffer_size;
+ driver->Viewport = viewport;
driver->Flush = flush;
driver->Finish = finish;
driver->Clear = clear;
@@ -1271,11 +1281,8 @@ DMesaMakeCurrent (DMesaContext c, DMesaBuffer b)
c->buffer = b;
_mesa_make_current((GLcontext *)c, (GLframebuffer *)b);
- if (((GLcontext *)c)->Viewport.Width == 0) {
- /* initialize viewport to window size */
- _mesa_Viewport(0, 0, b->width, b->height);
- }
- } else {
+ }
+ else {
/* Detach */
_mesa_make_current(NULL, NULL);
}