}
if (!drawBuffer) {
/* drawable must be a new window! */
- drawBuffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, draw, xmctx);
+ drawBuffer = XMesaCreateWindowBuffer( xmctx->xm_visual, draw );
if (!drawBuffer) {
/* Out of memory, or context/drawable depth mismatch */
return False;
}
+#ifdef FX
+ FXcreateContext( xmctx->xm_visual, draw, xmctx, drawBuffer );
+#endif
}
/* Find the XMesaBuffer which corresponds to the GLXDrawable 'read' */
}
if (!readBuffer) {
/* drawable must be a new window! */
- readBuffer = XMesaCreateWindowBuffer2(glxCtx->xmesaContext->xm_visual,
- read, xmctx);
+ readBuffer = XMesaCreateWindowBuffer( xmctx->xm_visual, read );
if (!readBuffer) {
/* Out of memory, or context/drawable depth mismatch */
return False;
}
+#ifdef FX
+ FXcreateContext( xmctx->xm_visual, read, xmctx, readBuffer );
+#endif
}
MakeCurrent_PrevContext = ctx;
if (!xmvis)
return 0;
- xmbuf = XMesaCreateWindowBuffer2(xmvis, win, NULL);
+ xmbuf = XMesaCreateWindowBuffer(xmvis, win);
if (!xmbuf)
return 0;
+#ifdef FX
+ /* XXX this will segfault if actually called */
+ FXcreateContext(xmvis, win, NULL, xmbuf);
+#endif
+
(void) dpy;
(void) attribList; /* Ignored in GLX 1.3 */
* X window or pixmap.
* \param v the window's XMesaVisual
* \param w the window we're wrapping
- * \param c context used to initialize the buffer if 3Dfx mode in use.
* \return new XMesaBuffer or NULL if error
*/
-XMesaBuffer
-XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c)
+PUBLIC XMesaBuffer
+XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w)
{
#ifndef XFree86Server
XWindowAttributes attr;
-#endif
-#ifdef FX
- char *fxEnvVar;
#endif
int client = 0;
XMesaBuffer b;
assert(v);
assert(w);
- (void) c;
/* Check that window depth matches visual depth */
#ifdef XFree86Server
return NULL;
}
+ return b;
+}
+
#ifdef FX
- fxEnvVar = _mesa_getenv("MESA_GLX_FX");
+void
+FXcreateContext(XMesaVisual v, XMesaWindow w, XMesaContext c, XMesaBuffer b)
+{
+ char *fxEnvVar = _mesa_getenv("MESA_GLX_FX");
if (fxEnvVar) {
if (fxEnvVar[0]!='d') {
int attribs[100];
_mesa_warning(NULL, " (check the README.3DFX file for more information).\n\n");
_mesa_warning(NULL, " you can disable this message with a 'export MESA_GLX_FX=disable'.\n");
}
-#endif
-
- return b;
-}
-
-
-PUBLIC XMesaBuffer
-XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w)
-{
- return XMesaCreateWindowBuffer2( v, w, NULL );
}
+#endif
/**
/*
* Switch 3Dfx support hack between window and full-screen mode.
*/
+#ifdef FX
GLboolean XMesaSetFXmode( GLint mode )
{
-#ifdef FX
const char *fx = _mesa_getenv("MESA_GLX_FX");
if (fx && fx[0] != 'd') {
GET_CURRENT_CONTEXT(ctx);
}
}
/*fprintf(stderr, "fallthrough\n");*/
+ return GL_FALSE;
+}
#else
+GLboolean XMesaSetFXmode( GLint mode )
+{
(void) mode;
-#endif
return GL_FALSE;
}
+#endif
/* XXX this is a hack to implement shared display lists with 3Dfx */
-extern XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v,
- XMesaWindow w,
- XMesaContext c );
+extern void FXcreateContext( XMesaVisual v,
+ XMesaWindow w,
+ XMesaContext c,
+ XMesaBuffer b );
#define ENABLE_EXT_texure_compression_s3tc 0 /* SW texture compression */