#include <GL/gl.h>
#include <GL/glx.h>
+#include "context.h"
#include "dlwrap.h"
#include "glwrap.h"
#include "metrics.h"
{
GLWRAP_DEFER (glXSwapBuffers, dpy, drawable);
+ metrics_counter_stop ();
+
metrics_end_frame ();
+
+ metrics_counter_start ();
}
/* glXGetProcAddressARB is a function which accepts a string and
*/
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;
{
Bool ret;
- fips_dispatch_init (FIPS_API_GLX);
+ context_leave ();
GLWRAP_DEFER_WITH_RETURN (ret, glXMakeCurrent, dpy, drawable, ctx);
+ context_enter (FIPS_API_GLX, ctx);
+
+ return ret;
+}
+
+Bool
+glXMakeContextCurrent (Display *dpy, GLXDrawable drawable, GLXDrawable read, GLXContext ctx)
+{
+ Bool ret;
+
+ context_leave ();
+
+ GLWRAP_DEFER_WITH_RETURN (ret, glXMakeContextCurrent, dpy, drawable, read, ctx);
+
+ context_enter (FIPS_API_GLX, ctx);
+
return ret;
}