From b61062a780ddc9eea7217cb4f110cb65e5148b23 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Fri, 20 Sep 2013 16:39:17 -0700 Subject: [PATCH] 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. --- glfps.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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); +} -- 2.43.0