]> git.cworth.org Git - glfps/blobdiff - glfps.c
Add support for glXGetProcAddress as well
[glfps] / glfps.c
diff --git a/glfps.c b/glfps.c
index e6739e4fad279588459ba6723dffb8119a58ef02..a23dd2098d22289d61c2f9351194751d6c7fa556 100644 (file)
--- a/glfps.c
+++ b/glfps.c
@@ -61,3 +61,17 @@ void
 
        return real_glXGetProcAddressARB (func);
 }
+
+void
+(*glXGetProcAddress (const GLubyte *func))(void)
+{
+       static typeof(&glXGetProcAddress) real_glXGetProcAddress = NULL;
+
+       if (strcmp((char *) func, "glXSwapBuffers") == 0)
+               return (void*) glXSwapBuffers;
+
+       if (real_glXGetProcAddress == NULL)
+               real_glXGetProcAddress = dlsym (RTLD_NEXT, "glXGetProcAddress");
+
+       return real_glXGetProcAddress (func);
+}