diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2006-10-14 23:02:26 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2006-10-14 23:02:26 +0000 |
commit | 9cbe0e24ac3772ec5db303e532166351affc91c9 (patch) | |
tree | 930a02b07f1bbf22c34d76280b7d32f843e6e4c0 /src/mesa/drivers/osmesa/osmesa.c | |
parent | d21fa9cd79e4198b673c1453b8bc05749f8a73eb (diff) |
Some code movement so that the gl_framebuffer is fully initialized before
calling _mesa_make_current() to avoid hitting the initialize_framebuffer_size()
stuff in context.c
Diffstat (limited to 'src/mesa/drivers/osmesa/osmesa.c')
-rw-r--r-- | src/mesa/drivers/osmesa/osmesa.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 942692c8bb0..4ac5a043fa6 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1376,21 +1376,25 @@ OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, GLenum type, */ _glapi_check_multithread(); + /* Set the framebuffer's size. This causes the + * osmesa_renderbuffer_storage() function to get called. + */ + _mesa_resize_framebuffer(&osmesa->mesa, osmesa->gl_buffer, width, height); + osmesa->gl_buffer->Initialized = GL_TRUE; /* XXX TEMPORARY? */ + _mesa_make_current( &osmesa->mesa, osmesa->gl_buffer, osmesa->gl_buffer ); + /* Set the color renderbuffer's pointer to the user buffer, + * update row pointers, etc. + */ if (osmesa->userRowLength) osmesa->rowlength = osmesa->userRowLength; else osmesa->rowlength = width; - osmesa->rb->Data = buffer; osmesa->rb->DataType = type; compute_row_addresses( osmesa ); - /* update the color renderbuffer's format, type, width, height */ - osmesa_renderbuffer_storage(&osmesa->mesa, osmesa->rb, - osmesa->rb->InternalFormat, width, height); - /* Remove renderbuffer attachment, then re-add. This installs the * renderbuffer adaptor/wrapper if needed. */ |