X-Git-Url: https://git.cworth.org/git?p=glfps;a=blobdiff_plain;f=glfps.c;h=e6739e4fad279588459ba6723dffb8119a58ef02;hp=68d389a75d2cb10e71b1d9c7548d0160d941073a;hb=b61062a780ddc9eea7217cb4f110cb65e5148b23;hpb=6f86ce127d3789cf4ce26c2d4132d6fa77bc62bc 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); +}