diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 6f4a51e1072..3031c6c9f07 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -591,11 +591,9 @@ _mesa_ReadBuffer(GLenum buffer) * \note This function should only be called through the GL API, not * from device drivers (as was done in the past). */ -void GLAPIENTRY -_mesa_ResizeBuffersMESA( void ) -{ - GET_CURRENT_CONTEXT(ctx); +void _mesa_resizebuffers( GLcontext *ctx ) +{ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx ); if (MESA_VERBOSE & VERBOSE_API) @@ -637,6 +635,14 @@ _mesa_ResizeBuffersMESA( void ) ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */ } +void GLAPIENTRY +_mesa_ResizeBuffersMESA( void ) +{ + GET_CURRENT_CONTEXT(ctx); + + _mesa_resizebuffers( ctx ); +} + /* * XXX move somewhere else someday? diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h index b61bdad4330..fcc21523421 100644 --- a/src/mesa/main/buffers.h +++ b/src/mesa/main/buffers.h @@ -78,4 +78,6 @@ extern void _mesa_set_scissor(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height); +extern void _mesa_resizebuffers( GLcontext *ctx ); + #endif diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index afe6048c802..7b57a01d132 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -704,9 +704,7 @@ alloc_shared_state( GLcontext *ctx ) ss->ArrayObjects = _mesa_NewHashTable(); -#if FEATURE_ARB_shader_objects ss->GL2Objects = _mesa_NewHashTable (); -#endif ss->Default1D = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_1D); if (!ss->Default1D) @@ -777,10 +775,8 @@ alloc_shared_state( GLcontext *ctx ) if (ss->ArrayObjects) _mesa_DeleteHashTable (ss->ArrayObjects); -#if FEATURE_ARB_shader_objects if (ss->GL2Objects) _mesa_DeleteHashTable (ss->GL2Objects); -#endif #if FEATURE_EXT_framebuffer_object if (ss->FrameBuffers) @@ -933,9 +929,7 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss ) _mesa_HashDeleteAll(ss->ArrayObjects, delete_arrayobj_cb, ctx); _mesa_DeleteHashTable(ss->ArrayObjects); -#if FEATURE_ARB_shader_objects _mesa_DeleteHashTable(ss->GL2Objects); -#endif #if FEATURE_EXT_framebuffer_object _mesa_DeleteHashTable(ss->FrameBuffers); @@ -1713,6 +1707,8 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, if (readBuffer != drawBuffer && !readBuffer->Initialized) { initialize_framebuffer_size(newCtx, readBuffer); } + + _mesa_resizebuffers(newCtx); #endif if (newCtx->FirstTimeCurrent) { /* set initial viewport and scissor size now */