X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glxwrap.c;h=59d3e8eb35cdd9818b6f1d5678133f00a5d90a9f;hb=5169acf1de805f8ad277554f6ec064e8f36111c3;hp=799a0190f794de1a63346c372f17b2148835879d;hpb=5569357a9fc7189c2bae43773f44ba576583ec2b;p=fips diff --git a/glxwrap.c b/glxwrap.c index 799a019..59d3e8e 100644 --- a/glxwrap.c +++ b/glxwrap.c @@ -40,17 +40,21 @@ glXSwapBuffers (Display *dpy, GLXDrawable drawable) } /* glXGetProcAddressARB is a function which accepts a string and - * returns a generic function pointer (which nominall accepts void and + * returns a generic function pointer (which nominally accepts void and * has void return type). Of course, the user is expected to cast the * returned function pointer to a function pointer of the expected * type. */ 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; @@ -60,6 +64,17 @@ void (*glXGetProcAddressARB (const GLubyte *func))(void) return ret; } +void (*glXGetProcAddress (const GLubyte *func))(void) +{ + /* This comment must not be removed. It ensures that the + * glXGetProcAddress function ends up in our exported symbol + * list even though there's not otherwise any code saying: + * + * GLWRAP_DEFER_WITH_RETURN (ret, glXGetProcAddress, func); + */ + return glXGetProcAddressARB(func); +} + Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx) { @@ -71,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; +}