]> git.cworth.org Git - fips/blobdiff - glxwrap.c
Generalize glXGetProcAddressARB wrapper to work for all wrapper functions
[fips] / glxwrap.c
index 80ccf1afdb6ed7148b81f1a04a30cd628b58b4da..4d16e4d6a1b86c093bbad6f4d8b1f35ff337e0f8 100644 (file)
--- a/glxwrap.c
+++ b/glxwrap.c
@@ -98,6 +98,7 @@ typedef __GLXextFuncPtr (* fips_glXGetProcAddressARB_t)(const GLubyte *func);
 __GLXextFuncPtr
 glXGetProcAddressARB (const GLubyte *func)
 {
+       __GLXextFuncPtr ptr;
        static fips_glXGetProcAddressARB_t real_glXGetProcAddressARB = NULL;
        const char *name = "glXGetProcAddressARB";
 
@@ -110,8 +111,11 @@ glXGetProcAddressARB (const GLubyte *func)
                }
        }
 
-       if (strcmp ((const char *)func, "glXSwapBuffers") == 0)
-               return (__GLXextFuncPtr) glXSwapBuffers;
-       else
-               return real_glXGetProcAddressARB (func);
+       /* If our library has this symbol, that's what we want to give. */
+       ptr = dlwrap_real_dlsym (NULL, (const char *) func);
+       if (ptr)
+               return ptr;
+
+       /* Otherwise, just defer to the real glXGetProcAddressARB. */
+       return real_glXGetProcAddressARB (func);
 }