summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/x11/xm_api.c21
-rw-r--r--src/mesa/drivers/x11/xm_glide.c21
-rw-r--r--src/mesa/drivers/x11/xm_glide.h4
-rw-r--r--src/mesa/drivers/x11/xmesaP.h1
4 files changed, 32 insertions, 15 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 692eb5f807..5e2327a2d3 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -1557,12 +1557,11 @@ PUBLIC
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 );
@@ -1767,15 +1766,6 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
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
@@ -1786,6 +1776,11 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
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.
*/
diff --git a/src/mesa/drivers/x11/xm_glide.c b/src/mesa/drivers/x11/xm_glide.c
index 37787a7922..ae4f4282db 100644
--- a/src/mesa/drivers/x11/xm_glide.c
+++ b/src/mesa/drivers/x11/xm_glide.c
@@ -27,6 +27,8 @@
#include "xmesaP.h"
#ifdef FX
+#include "../glide/fxdrv.h"
+
void
FXcreateContext(XMesaVisual v, XMesaWindow w, XMesaContext c, XMesaBuffer b)
{
@@ -109,6 +111,24 @@ 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.
*/
@@ -118,7 +138,6 @@ static void FXgetImage( XMesaBuffer b )
static unsigned short pixbuf[MAX_WIDTH];
GLuint x, y;
GLuint width, height;
- XMesaContext xmesa = XMESA_CONTEXT(ctx);
#ifdef XFree86Server
x = b->frontxrb->pixmap->x;
diff --git a/src/mesa/drivers/x11/xm_glide.h b/src/mesa/drivers/x11/xm_glide.h
index 7458c57415..f7d0316524 100644
--- a/src/mesa/drivers/x11/xm_glide.h
+++ b/src/mesa/drivers/x11/xm_glide.h
@@ -31,6 +31,10 @@ extern void FXcreateContext( XMesaVisual v,
XMesaContext c,
XMesaBuffer b );
+extern void FXdestroyContext( XMesaBuffer b );
+
+extern GLboolean FXmakeCurrent( XMesaBuffer b );
+
extern GLboolean FXswapBuffers( XMesaBuffer b );
#endif /* _XM_GLIDE_H_ */
diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h
index cae5c0d9bc..0198886747 100644
--- a/src/mesa/drivers/x11/xmesaP.h
+++ b/src/mesa/drivers/x11/xmesaP.h
@@ -31,7 +31,6 @@
#include "mtypes.h"
#if defined(FX)
#include "GL/fxmesa.h"
-#include "../glide/fxdrv.h"
#include "xm_glide.h"
#endif
#ifdef XFree86Server