check if ctx->Driver.GetBufferSize==NULL and no-op
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 17 Oct 2006 17:43:47 +0000 (17:43 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 17 Oct 2006 17:43:47 +0000 (17:43 +0000)
src/mesa/main/buffers.c
src/mesa/main/context.c

index 8d77b3cb8a0d9b603a430f13f4bcd61e484892ae..2710d044545564173c13338165872c9020d27aac 100644 (file)
@@ -604,6 +604,10 @@ void _mesa_resizebuffers( GLcontext *ctx )
    if (MESA_VERBOSE & VERBOSE_API)
       _mesa_debug(ctx, "glResizeBuffersMESA\n");
 
+   if (!ctx->Driver.GetBufferSize) {
+      return;
+   }
+
    if (ctx->WinSysDrawBuffer) {
       GLuint newWidth, newHeight;
       GLframebuffer *buffer = ctx->WinSysDrawBuffer;
index f6f9e9012676f889e9e7cf4d5568403ee71147ca..e0630c33d0b0c95439f41688b333df75a6a15743 100644 (file)
@@ -1629,11 +1629,12 @@ static void
 initialize_framebuffer_size(GLcontext *ctx, GLframebuffer *fb)
 {
    GLuint width, height;
-   ASSERT(ctx->Driver.GetBufferSize);
-   ctx->Driver.GetBufferSize(fb, &width, &height);
-   if (ctx->Driver.ResizeBuffers)
-      ctx->Driver.ResizeBuffers(ctx, fb, width, height);
-   fb->Initialized = GL_TRUE;
+   if (ctx->Driver.GetBufferSize) {
+      ctx->Driver.GetBufferSize(fb, &width, &height);
+      if (ctx->Driver.ResizeBuffers)
+         ctx->Driver.ResizeBuffers(ctx, fb, width, height);
+      fb->Initialized = GL_TRUE;
+   }
 }