check the current window size, then call _mesa_resize_framebuffer().
}\r
\r
\r
+/**\r
+ * We only implement this function as a mechanism to check if the\r
+ * framebuffer size has changed (and update corresponding state).\r
+ */\r
static void viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)\r
{\r
/* poll for window size change and realloc software Z/stencil/etc if needed */\r
- _mesa_ResizeBuffersMESA();\r
+ GLuint newWidth, newHeight;\r
+ GLframebuffer *buffer = ctx->WinSysDrawBuffer;\r
+ get_buffer_size( &newWidth, &newHeight );\r
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {\r
+ _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );\r
+ }\r
+\r
}\r
\r
\r
if (data->width != width || data->height != height) {
data->width = width;
data->height = height;
- _mesa_ResizeBuffersMESA();
+ _mesa_resize_framebuffer(&data->context,
+ &data->framebuffer, width, height);
}
data->locked = DFB_TRUE;
*height = (GLuint) data->height;
}
+/**
+ * We only implement this function as a mechanism to check if the
+ * framebuffer size has changed (and update corresponding state).
+ */
static void
dfbSetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h )
{
- _mesa_ResizeBuffersMESA();
+ GLuint newWidth, newHeight;
+ GLframebuffer *buffer = ctx->WinSysDrawBuffer;
+ dfbGetBufferSize( buffer, &newWidth, &newHeight );
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );
+ }
}
static void
}
+/**
+ * We only implement this function as a mechanism to check if the
+ * framebuffer size has changed (and update corresponding state).
+ */
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();
+ GLuint newWidth, newHeight;
+ GLframebuffer *buffer;
+
+ buffer = ctx->WinSysDrawBuffer;
+ get_buffer_size( buffer, &newWidth, &newHeight );
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );
+ }
+
+ buffer = ctx->WinSysReadBuffer;
+ get_buffer_size( buffer, &newWidth, &newHeight );
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );
+ }
}
printf("returning %d, %d\n", *width, *height);
}
+/**
+ * We only implement this function as a mechanism to check if the
+ * framebuffer size has changed (and update corresponding state).
+ */
static void gl_ggiViewport(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();
+ GLuint newWidth, newHeight;
+ GLframebuffer *buffer = ctx->WinSysDrawBuffer;
+ gl_ggiGetSize( buffer, &newWidth, &newHeight );
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );
+ }
}
}
+/**
+ * We only implement this function as a mechanism to check if the
+ * framebuffer size has changed (and update corresponding state).
+ */
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();
+ GLuint newWidth, newHeight;
+ GLframebuffer *buffer = ctx->WinSysDrawBuffer;
+ fxDDGetBufferSize( buffer, &newWidth, &newHeight );
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );
+ }
}
-/* $Id: svgamesa.c,v 1.26 2005/09/07 23:26:01 brianp Exp $ */
+/* $Id: svgamesa.c,v 1.27 2006/10/15 18:51:22 brianp Exp $ */
/*
* Mesa 3-D graphics library
*height = SVGAMesa->height = vga_getydim();
}
+/**
+ * We only implement this function as a mechanism to check if the
+ * framebuffer size has changed (and update corresponding state).
+ */
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();
+ GLuint newWidth, newHeight;
+ GLframebuffer *buffer = ctx->WinSysDrawBuffer;
+ get_buffer_size( buffer, &newWidth, &newHeight );
+ if (buffer->Width != newWidth || buffer->Height != newHeight) {
+ _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight );
+ }
}
static void set_buffer( GLcontext *ctx, GLframebuffer *colorBuffer,