-/* $Id: svgamesa.c,v 1.23 2002/11/11 18:42:38 brianp Exp $ */
+/* $Id: svgamesa.c,v 1.26 2005/09/07 23:26:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include <string.h>
#include <vga.h>
#include "GL/svgamesa.h"
+#include "buffers.h"
#include "context.h"
#include "extensions.h"
#include "imports.h"
*height = SVGAMesa->height = vga_getydim();
}
+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 void set_buffer( GLcontext *ctx, GLframebuffer *colorBuffer,
GLenum buffer )
ctx->Driver.UpdateState = svgamesa_update_state;
ctx->Driver.GetBufferSize = get_buffer_size;
- ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
-
- /* Software rasterizer pixel paths:
- */
- ctx->Driver.Accum = _swrast_Accum;
- ctx->Driver.Bitmap = _swrast_Bitmap;
- ctx->Driver.CopyPixels = _swrast_CopyPixels;
- ctx->Driver.DrawPixels = _swrast_DrawPixels;
- ctx->Driver.ReadPixels = _swrast_ReadPixels;
- ctx->Driver.DrawBuffer = _swrast_DrawBuffer;
+ ctx->Driver.Viewport = viewport;
/* Fill in the swrast driver interface:
*/
_mesa_enable_sw_extensions(ctx->gl_ctx);
_mesa_enable_1_3_extensions(ctx->gl_ctx);
+ _mesa_init_driver_functions(&ctx->Driver);
+
ctx->gl_buffer = _mesa_create_framebuffer( ctx->gl_vis,
ctx->gl_vis->depthBits > 0,
ctx->gl_vis->stencilBits > 0,
_mesa_make_current( ctx->gl_ctx, ctx->gl_buffer );
if (ctx->width==0 || ctx->height==0) {
- /* setup initial viewport */
ctx->width = vga_getxdim();
ctx->height = vga_getydim();
- _mesa_set_viewport( ctx->gl_ctx, 0, 0, ctx->width, ctx->height );
}
#endif
}
* Need this to provide at least one external definition when SVGA is
* not defined on the compiler command line.
*/
-
+extern int gl_svga_dummy_function(void);
int gl_svga_dummy_function(void)
{
return 0;