/* XXX these may have to be removed due to thread-safety issues. */
static GLXContext MakeCurrent_PrevContext = 0;
-static GLXDrawable MakeCurrent_PrevDrawable = 0;
-static GLXDrawable MakeCurrent_PrevReadable = 0;
-static XMesaBuffer MakeCurrent_PrevDrawBuffer = 0;
-static XMesaBuffer MakeCurrent_PrevReadBuffer = 0;
/* GLX 1.3 and later */
XMesaContext xmctx = glxCtx->xmesaContext;
/* Find the XMesaBuffer which corresponds to the GLXDrawable 'draw' */
- if (ctx == MakeCurrent_PrevContext
- && draw == MakeCurrent_PrevDrawable) {
- drawBuffer = MakeCurrent_PrevDrawBuffer;
- }
- else {
+ if (ctx == MakeCurrent_PrevContext) {
drawBuffer = XMesaFindBuffer( dpy, draw );
}
if (!drawBuffer) {
}
/* Find the XMesaBuffer which corresponds to the GLXDrawable 'read' */
- if (ctx == MakeCurrent_PrevContext
- && read == MakeCurrent_PrevReadable) {
- readBuffer = MakeCurrent_PrevReadBuffer;
- }
- else {
+ if (ctx == MakeCurrent_PrevContext) {
readBuffer = XMesaFindBuffer( dpy, read );
}
if (!readBuffer) {
}
}
- if (no_rast &&
- MakeCurrent_PrevContext == ctx &&
- MakeCurrent_PrevDrawable == draw &&
- MakeCurrent_PrevReadable == read &&
- MakeCurrent_PrevDrawBuffer == drawBuffer &&
- MakeCurrent_PrevReadBuffer == readBuffer)
+ if (no_rast && MakeCurrent_PrevContext == ctx)
return True;
MakeCurrent_PrevContext = ctx;
- MakeCurrent_PrevDrawable = draw;
- MakeCurrent_PrevReadable = read;
- MakeCurrent_PrevDrawBuffer = drawBuffer;
- MakeCurrent_PrevReadBuffer = readBuffer;
/* Now make current! */
if (XMesaMakeCurrent2(xmctx, drawBuffer, readBuffer)) {
/* release current context w/out assigning new one. */
XMesaMakeCurrent2( NULL, NULL, NULL );
MakeCurrent_PrevContext = 0;
- MakeCurrent_PrevDrawable = 0;
- MakeCurrent_PrevReadable = 0;
- MakeCurrent_PrevDrawBuffer = 0;
- MakeCurrent_PrevReadBuffer = 0;
SetCurrentContext(NULL);
return True;
}
GLXContext glxCtx = ctx;
(void) dpy;
MakeCurrent_PrevContext = 0;
- MakeCurrent_PrevDrawable = 0;
- MakeCurrent_PrevReadable = 0;
- MakeCurrent_PrevDrawBuffer = 0;
- MakeCurrent_PrevReadBuffer = 0;
XMesaDestroyContext( glxCtx->xmesaContext );
XMesaGarbageCollect();
free(glxCtx);