diff options
author | Brian Paul <[email protected]> | 1999-09-16 15:52:51 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 1999-09-16 15:52:51 +0000 |
commit | 43c9c2cfae458cf0d7618af5f25d57c0a5ebae08 (patch) | |
tree | 547b70f8336d83be2771c11599b66eb0310c0bbe /src/mesa/drivers/x11 | |
parent | 17f0efb89639251527a80744f4db52b36cf6341e (diff) |
added GLX_MESA_set_3dfx_mode. clean-up of glXGetProcAddress
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r-- | src/mesa/drivers/x11/fakeglx.c | 55 | ||||
-rw-r--r-- | src/mesa/drivers/x11/glxapi.c | 23 |
2 files changed, 58 insertions, 20 deletions
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 87a9dd1b71e..716e0599b98 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $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 @@ -65,6 +65,17 @@ +/* Silence compiler warnings */ +void Fake_glXDummyFunc( void ) +{ + (void) kernel8; + (void) DitherValues; + (void) HPCR_DRGB; + (void) kernel1; +} + + + #define DONT_CARE -1 @@ -1387,17 +1398,28 @@ void Fake_glXWaitX( void ) } +/* + * 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(); } @@ -1405,7 +1427,6 @@ const char *Fake_glXQueryExtensionsString( Display *dpy, int screen ) /* 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"; @@ -1414,7 +1435,7 @@ const char *Fake_glXQueryServerString( Display *dpy, int screen, int name ) switch (name) { case GLX_EXTENSIONS: - return extensions; + return get_extensions(); case GLX_VENDOR: return vendor; case GLX_VERSION: @@ -1429,7 +1450,6 @@ const char *Fake_glXQueryServerString( Display *dpy, int screen, int name ) /* 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"; @@ -1437,7 +1457,7 @@ const char *Fake_glXGetClientString( Display *dpy, int name ) switch (name) { case GLX_EXTENSIONS: - return extensions; + return get_extensions(); case GLX_VENDOR: return vendor; case GLX_VERSION: @@ -1464,19 +1484,21 @@ Bool Fake_glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ) } -/* 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; }; @@ -1485,6 +1507,7 @@ GLfunction Fake_glXGetProcAddress( const GLubyte *procName ) { "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 */ }; diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index 23b23b90cb4..dba92aa04dc 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -1,4 +1,4 @@ -/* $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 @@ -405,12 +405,27 @@ int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) #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 |