From: Carl Worth Date: Fri, 20 Sep 2013 23:39:17 +0000 (-0700) Subject: Add wrapper for glXGetProcAddressARB X-Git-Url: https://git.cworth.org/git?p=glfps;a=commitdiff_plain;h=b61062a780ddc9eea7217cb4f110cb65e5148b23 Add wrapper for glXGetProcAddressARB Some applications may be using this to get at the functions we want to wrap, so we have to wrap it as well. --- diff --git a/glfps.c b/glfps.c index 68d389a..e6739e4 100644 --- a/glfps.c +++ b/glfps.c @@ -8,6 +8,7 @@ #include #include +#include /* How many frames between reports. */ #define REPORT_FREQ 60 @@ -46,3 +47,17 @@ glXSwapBuffers (Display *dpy, GLXDrawable drawable) real_glXSwapBuffers (dpy, drawable); } + +void +(*glXGetProcAddressARB (const GLubyte *func))(void) +{ + static typeof(&glXGetProcAddressARB) real_glXGetProcAddressARB = NULL; + + if (strcmp((char *) func, "glXSwapBuffers") == 0) + return (void*) glXSwapBuffers; + + if (real_glXGetProcAddressARB == NULL) + real_glXGetProcAddressARB = dlsym (RTLD_NEXT, "glXGetProcAddressARB"); + + return real_glXGetProcAddressARB (func); +}