From: Brian Paul Date: Sat, 11 Sep 1999 11:33:45 +0000 (+0000) Subject: added GLX_EXT_get_proc_address X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=89a42b7e736bd9b0ab090906cab0cd047a6ec12e;p=mesa.git added GLX_EXT_get_proc_address --- diff --git a/include/GL/glx.h b/include/GL/glx.h index 4b27880eba9..4163fe28579 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: glx.h,v 1.2 1999/09/11 11:33:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -27,8 +27,11 @@ /* * $Log: glx.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision + * Revision 1.2 1999/09/11 11:33:45 brianp + * added GLX_EXT_get_proc_address + * + * Revision 1.1.1.1 1999/08/19 00:55:40 jtg + * Imported sources * * Revision 3.3 1999/02/14 03:39:09 brianp * new copyright @@ -154,13 +157,12 @@ enum _GLX_CONFIGS { /* * Compile-time extension tests */ -#ifdef MESA #define GLX_EXT_visual_info 1 #define GLX_MESA_pixmap_colormap 1 #define GLX_MESA_release_buffers 1 #define GLX_MESA_copy_sub_buffer 1 #define GLX_SGI_video_sync 1 -#endif +#define GLX_EXT_get_proc_address 1 @@ -227,6 +229,9 @@ extern const char *glXQueryServerString( Display *dpy, int screen, int name ); extern const char *glXGetClientString( Display *dpy, int name ); +/* GLX_EXT_get_proc_address */ +extern GLfunction glXGetProcAddressEXT(const GLubyte *procName); + /* * Mesa GLX Extensions diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 2704e35ad59..108c5570191 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $Id: fakeglx.c,v 1.2 1999/09/03 11:53:33 keithw Exp $ */ +/* $Id: fakeglx.c,v 1.3 1999/09/11 11:35:11 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1472,3 +1472,29 @@ void Fake_glXDummyFunc( void ) (void) HPCR_DRGB; (void) kernel1; } + + +GLfunction Fake_glXGetProcAddress( const GLubyte *procName ) +{ + struct proc { + const char *name; + void *address; + }; + static struct proc procTable[] = { + { "glXGetProcAddressEXT", glXGetProcAddressEXT }, /* myself! */ + { "glXReleaseBuffersMESA", glXReleaseBuffersMESA }, + { "glXReleaseBuffersMESA", glXReleaseBuffersMESA }, + { "glXCopySubBufferMESA", glXCopySubBufferMESA }, + /* NOTE: GLX_SGI_video_sync not implemented in Mesa */ + { NULL, NULL } /* end of list token */ + }; + GLuint i; + + /* First, look for core library functions */ + for (i = 0; procTable[i].address; i++) { + if (strcmp((const char *) procName, procTable[i].name) == 0) + return (GLfunction) procTable[i].address; + } + + return NULL; +} diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index b65bada72b9..23b23b90cb4 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -1,4 +1,4 @@ -/* $Id: glxapi.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ +/* $Id: glxapi.c,v 1.2 1999/09/11 11:35:11 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -403,3 +403,14 @@ int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) } #endif + + +#ifdef GLX_EXT_get_proc_address +GLfunction glXGetProcAddressEXT( const GLubyte *procName ) +{ +#ifdef REALGLX + return 0; /* XXX todo */ +#endif + return Fake_glXGetProcAddress( procName ); +} +#endif