]> git.cworth.org Git - fips/blobdiff - glxwrap.c
glxwrap: Initialize fips_dispatch when glxMakeContextCurrent is called
[fips] / glxwrap.c
index d7d4191ce528ae5b59c5f8a9317b8e99a179d679..59d3e8eb35cdd9818b6f1d5678133f00a5d90a9f 100644 (file)
--- a/glxwrap.c
+++ b/glxwrap.c
@@ -47,10 +47,14 @@ glXSwapBuffers (Display *dpy, GLXDrawable drawable)
  */
 void (*glXGetProcAddressARB (const GLubyte *func))(void)
 {
+       static void *libfips_handle = NULL;
        void *ret;
 
+       if (libfips_handle == NULL)
+               libfips_handle = dlwrap_dlopen_libfips ();
+
        /* If our library has this symbol, that's what we want to give. */
-       ret = dlwrap_real_dlsym (NULL, (const char *) func);
+       ret = dlwrap_real_dlsym (libfips_handle, (const char *) func);
        if (ret)
                return ret;
 
@@ -82,3 +86,15 @@ glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx)
 
        return ret;
 }
+
+Bool
+glXMakeContextCurrent (Display *dpy, GLXDrawable drawable, GLXDrawable read, GLXContext ctx)
+{
+       Bool ret;
+
+       fips_dispatch_init (FIPS_API_GLX);
+
+       GLWRAP_DEFER_WITH_RETURN (ret, glXMakeContextCurrent, dpy, drawable, read, ctx);
+
+       return ret;
+}