void XMesaDestroyContext( XMesaContext c )
{
GLcontext *mesaCtx = &c->mesa;
-#ifdef FX
- XMesaBuffer xmbuf = XMESA_BUFFER(mesaCtx->DrawBuffer);
- if (xmbuf && xmbuf->FXctx)
- fxMesaDestroyContext(xmbuf->FXctx);
+#ifdef FX
+ FXdestroyContext( XMESA_BUFFER(mesaCtx->DrawBuffer) );
#endif
+
_swsetup_DestroyContext( mesaCtx );
_swrast_DestroyContext( mesaCtx );
_tnl_DestroyContext( mesaCtx );
if (!drawBuffer || !readBuffer)
return GL_FALSE; /* must specify buffers! */
-#ifdef FX
- if (drawBuffer->FXctx) {
- fxMesaMakeCurrent(drawBuffer->FXctx);
-
- c->xm_buffer = drawBuffer;
-
- return GL_TRUE;
- }
-#endif
if (&(c->mesa) == _mesa_get_current_context()
&& c->mesa.DrawBuffer == &drawBuffer->mesa_buffer
&& c->mesa.ReadBuffer == &readBuffer->mesa_buffer
c->xm_buffer = drawBuffer;
+#ifdef FX
+ if (FXmakeCurrent( drawBuffer ))
+ return GL_TRUE;
+#endif
+
/* Call this periodically to detect when the user has begun using
* GL rendering from multiple threads.
*/
#include "xmesaP.h"
#ifdef FX
+#include "../glide/fxdrv.h"
+
void
FXcreateContext(XMesaVisual v, XMesaWindow w, XMesaContext c, XMesaBuffer b)
{
}
+void FXdestroyContext( XMesaBuffer b )
+{
+ if (b && b->FXctx)
+ fxMesaDestroyContext(b->FXctx);
+}
+
+
+GLboolean FXmakeCurrent( XMesaBuffer b )
+{
+ if (b->FXctx) {
+ fxMesaMakeCurrent(b->FXctx);
+
+ return GL_TRUE;
+ }
+ return GL_FALSE;
+}
+
+
/*
* Read image from VooDoo frame buffer into X/Mesa's back XImage.
*/
static unsigned short pixbuf[MAX_WIDTH];
GLuint x, y;
GLuint width, height;
- XMesaContext xmesa = XMESA_CONTEXT(ctx);
#ifdef XFree86Server
x = b->frontxrb->pixmap->x;
XMesaContext c,
XMesaBuffer b );
+extern void FXdestroyContext( XMesaBuffer b );
+
+extern GLboolean FXmakeCurrent( XMesaBuffer b );
+
extern GLboolean FXswapBuffers( XMesaBuffer b );
#endif /* _XM_GLIDE_H_ */