diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2004-11-27 22:47:59 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2004-11-27 22:47:59 +0000 |
commit | 65a66f5bc37383c00423c21baf8ba9d6771e0259 (patch) | |
tree | 0d98e004b457adde579dd27b9fe32182d54268b6 /src/mesa/drivers/allegro | |
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/allegro')
-rw-r--r-- | src/mesa/drivers/allegro/amesa.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mesa/drivers/allegro/amesa.c b/src/mesa/drivers/allegro/amesa.c index 92fd1b7068..cb46efa56a 100644 --- a/src/mesa/drivers/allegro/amesa.c +++ b/src/mesa/drivers/allegro/amesa.c @@ -21,6 +21,7 @@ #include <stdio.h>
#include <stdlib.h>
#include <allegro.h>
+#include "buffers.h"
#include "context.h"
#include "imports.h"
#include "matrix.h"
@@ -144,6 +145,13 @@ static void get_buffer_size(GLcontext *ctx, 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();
+}
+
+
/**********************************************************************/
/**********************************************************************/
@@ -155,8 +163,9 @@ static void setup_dd_pointers(GLcontext *ctx) /* a new context is made current or we change buffers via set_buffer! */
ctx->Driver.UpdateState = setup_dd_pointers;
- ctx->Driver.SetBuffer = set_buffer;
- ctx->Driver.GetBufferSize = get_buffer_size;
+ ctx->Driver.SetBuffer = set_buffer;
+ ctx->Driver.GetBufferSize = get_buffer_size;
+ ctx->Driver.Viewport = viewport;
ctx->Driver.Color = set_color_generic;
ctx->Driver.ClearColor = clear_color_generic;
@@ -371,9 +380,9 @@ GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer) setup_dd_pointers(context->GLContext);
_mesa_make_current(context->GLContext, buffer->GLBuffer);
- _mesa_set_viewport(context->GLContext, 0, 0, buffer->Width, buffer->Height);
}
else {
+ /* XXX I don't think you want to destroy anything here! */ destroy_bitmap(context->Buffer->Screen);
context->Buffer->Screen = NULL;
context->Buffer->Active = NULL;
|