-/* $Id: glx.h,v 1.2 1999/09/11 11:33:45 brianp Exp $ */
+/* $Id: glx.h,v 1.3 1999/09/16 15:52:51 brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* $Log: glx.h,v $
+ * Revision 1.3 1999/09/16 15:52:51 brianp
+ * added GLX_MESA_set_3dfx_mode. clean-up of glXGetProcAddress
+ *
* Revision 1.2 1999/09/11 11:33:45 brianp
* added GLX_EXT_get_proc_address
*
* Compile-time extension tests
*/
#define GLX_EXT_visual_info 1
+#define GLX_EXT_get_proc_address 1
#define GLX_MESA_pixmap_colormap 1
#define GLX_MESA_release_buffers 1
#define GLX_MESA_copy_sub_buffer 1
+#define GLX_MESA_set_3dfx_mode 1
#define GLX_SGI_video_sync 1
-#define GLX_EXT_get_proc_address 1
extern const char *glXGetClientString( Display *dpy, int name );
-/* GLX_EXT_get_proc_address */
-extern GLfunction glXGetProcAddressEXT(const GLubyte *procName);
-
-/*
- * Mesa GLX Extensions
+/* GLX_EXT_get_proc_address */
+/* WARNING: this extension is not finalized yet! Do not release code
+ * which uses this extension yet! It may change!
*/
+extern void (*glXGetProcAddressEXT(const GLubyte *procName))();
-#ifdef GLX_MESA_pixmap_colormap
+
+/* GLX_MESA_pixmap_colormap */
extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
Pixmap pixmap, Colormap cmap );
-#endif
-#ifdef GLX_MESA_release_buffers
+
+/* GLX_MESA_release_buffers */
extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
-#endif
-#ifdef GLX_MESA_copy_sub_buffer
+
+/* GLX_MESA_copy_sub_buffer */
extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
int x, int y, int width, int height );
-#endif
-#ifdef GLX_SGI_video_sync
+
+/* GLX_MESA_set_3dfx_mode */
+extern GLboolean glXSet3DfxModeMESA( GLint mode );
+
+
+/* GLX_SGI_video_sync */
extern int glXGetVideoSyncSGI(unsigned int *count);
extern int glXWaitVideoSyncSGI(int divisor, int remainder,
unsigned int *count);
-#endif
-/* $Id: fakeglx.c,v 1.6 1999/09/15 20:04:04 brianp Exp $ */
+/* $Id: fakeglx.c,v 1.7 1999/09/16 15:53:51 brianp Exp $ */
/*
* Mesa 3-D graphics library
+/* Silence compiler warnings */
+void Fake_glXDummyFunc( void )
+{
+ (void) kernel8;
+ (void) DitherValues;
+ (void) HPCR_DRGB;
+ (void) kernel1;
+}
+
+
+
#define DONT_CARE -1
}
+/*
+ * Return the extensions string, which is 3Dfx-dependant.
+ */
+static const char *get_extensions( void )
+{
+#ifdef FX
+ const char *fx = getenv("MESA_GLX_FX");
+ if (fx && fx[0] != 'd') {
+ return "GLX_MESA_pixmap_colormap GLX_EXT_visual_info GLX_MESA_release_buffers GLX_MESA_copy_sub_buffer GLX_SGI_video_sync GLX_MESA_set_3dfx_mode";
+ }
+#endif
+ return "GLX_MESA_pixmap_colormap GLX_EXT_visual_info GLX_MESA_release_buffers GLX_MESA_copy_sub_buffer GLX_SGI_video_sync";
+}
-#define EXTENSIONS "GLX_MESA_pixmap_colormap GLX_EXT_visual_info GLX_MESA_release_buffers GLX_MESA_copy_sub_buffer GLX_SGI_video_sync"
/* GLX 1.1 and later */
const char *Fake_glXQueryExtensionsString( Display *dpy, int screen )
{
- static char *extensions = EXTENSIONS;
(void) dpy;
(void) screen;
- return extensions;
+ return get_extensions();
}
/* GLX 1.1 and later */
const char *Fake_glXQueryServerString( Display *dpy, int screen, int name )
{
- static char *extensions = EXTENSIONS;
static char *vendor = "Brian Paul";
static char *version = "1.1 Mesa 3.1";
switch (name) {
case GLX_EXTENSIONS:
- return extensions;
+ return get_extensions();
case GLX_VENDOR:
return vendor;
case GLX_VERSION:
/* GLX 1.1 and later */
const char *Fake_glXGetClientString( Display *dpy, int name )
{
- static char *extensions = EXTENSIONS;
static char *vendor = "Brian Paul";
static char *version = "1.1 Mesa 3.1";
switch (name) {
case GLX_EXTENSIONS:
- return extensions;
+ return get_extensions();
case GLX_VENDOR:
return vendor;
case GLX_VERSION:
}
-/* Silence compiler warnings */
-void Fake_glXDummyFunc( void )
+/*
+ * GLX_MESA_set_3dfx_mode
+ */
+GLboolean Fake_glXSet3DfxModeMESA( GLint mode )
{
- (void) kernel8;
- (void) DitherValues;
- (void) HPCR_DRGB;
- (void) kernel1;
+ return XMesaSetFXmode( mode );
}
-GLfunction Fake_glXGetProcAddress( const GLubyte *procName )
+
+/*GLfunction Fake_glXGetProcAddress( const GLubyte *procName )*/
+void (*Fake_glXGetProcAddress( const GLubyte *procName ))()
{
- struct proc {
+ typedef void (*GLfunction)();
+ struct proc {
const char *name;
GLfunction address;
};
{ "glXCreateGLXPixmapMESA", (GLfunction) glXCreateGLXPixmapMESA },
{ "glXReleaseBuffersMESA", (GLfunction) glXReleaseBuffersMESA },
{ "glXCopySubBufferMESA", (GLfunction) glXCopySubBufferMESA },
+ { "glXSet3DfxModeMESA", (GLfunction) glXSet3DfxModeMESA },
/* NOTE: GLX_SGI_video_sync not implemented in Mesa */
{ NULL, NULL } /* end of list token */
};
-/* $Id: glxapi.c,v 1.2 1999/09/11 11:35:11 brianp Exp $ */
+/* $Id: glxapi.c,v 1.3 1999/09/16 15:54:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
#endif
-#ifdef GLX_EXT_get_proc_address
-GLfunction glXGetProcAddressEXT( const GLubyte *procName )
+
+#ifdef GLX_MESA_set_3dfx_mode
+GLboolean glXSet3DfxModeMESA( GLint mode )
{
#ifdef REALGLX
- return 0; /* XXX todo */
+ return GL_FALSE;
+#else
+ return Fake_glXSet3DfxModeMESA( mode );
#endif
+}
+#endif
+
+
+
+#ifdef GLX_EXT_get_proc_address
+void (*glXGetProcAddressEXT( const GLubyte *procName ))()
+{
+#ifdef REALGLX
+ return NULL;
+#else
return Fake_glXGetProcAddress( procName );
+#endif
}
#endif