use new _mesa_remove_renderbuffer()
authorBrian Paul <brian.paul@tungstengraphics.com>
Sat, 20 May 2006 15:12:42 +0000 (15:12 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Sat, 20 May 2006 15:12:42 +0000 (15:12 +0000)
src/mesa/drivers/osmesa/osmesa.c

index 9dccea92054225dc7307a69b14cf494426f7bf96..942692c8bb0c04816c3b2131ee3d4b07e5611ac4 100644 (file)
@@ -1391,18 +1391,13 @@ OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, GLenum type,
    osmesa_renderbuffer_storage(&osmesa->mesa, osmesa->rb,
                                osmesa->rb->InternalFormat, width, height);
 
-   /* Clear renderbuffer attachment, then re-add.  This installs the
+   /* Remove renderbuffer attachment, then re-add.  This installs the
     * renderbuffer adaptor/wrapper if needed.
     */
-   {
-      struct gl_renderbuffer *rb
-         = osmesa->gl_buffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
-      if (rb && rb->Wrapped != rb)
-         _mesa_free(rb);
-      osmesa->gl_buffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer = NULL;
-   }
+   _mesa_remove_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT);
    _mesa_add_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT, osmesa->rb);
 
+
    /* this updates the visual's red/green/blue/alphaBits fields */
    _mesa_update_framebuffer_visual(osmesa->gl_buffer);