- static fips_glXGetProcAddressARB_t real_glXGetProcAddressARB = NULL;
- const char *name = "glXGetProcAddressARB";
-
- if (! real_glXGetProcAddressARB) {
- real_glXGetProcAddressARB = (fips_glXGetProcAddressARB_t) lookup (name);
- if (! real_glXGetProcAddressARB) {
- fprintf (stderr, "Error: Failed to find function %s.\n",
- name);
- return NULL;
- }
- }
-
- if (strcmp ((const char *)func, "glXSwapBuffers") == 0)
- return (__GLXextFuncPtr) glXSwapBuffers;
- else
- return real_glXGetProcAddressARB (func);
+ Bool ret;
+
+ fips_dispatch_init (FIPS_API_GLX);
+
+ GLWRAP_DEFER_WITH_RETURN (ret, glXMakeContextCurrent, dpy, drawable, read, ctx);
+
+ metrics_counter_start ();
+
+ return ret;