X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glxwrap.c;h=78627d42005a223eca6128dd12177d06e8278257;hb=b8b9a79e315bf3a030c3b0840ad1490746b5a8e0;hp=4d16e4d6a1b86c093bbad6f4d8b1f35ff337e0f8;hpb=7f48ed429b393b28cb6362af5dcddd9bb27c3901;p=fips diff --git a/glxwrap.c b/glxwrap.c index 4d16e4d..78627d4 100644 --- a/glxwrap.c +++ b/glxwrap.c @@ -25,10 +25,10 @@ #include #include -#include - #include "dlwrap.h" +#include "glwrap.h" + typedef void (* fips_glXSwapBuffers_t)(Display *dpy, GLXDrawable drawable); static void * @@ -69,28 +69,9 @@ call_glXSwapBuffers (Display *dpy, GLXDrawable drawable) void glXSwapBuffers (Display *dpy, GLXDrawable drawable) { - static int initialized = 0; - static int frames; - static struct timeval tv_start, tv_now; - - if (! initialized) { - frames = 0; - gettimeofday (&tv_start, NULL); - initialized = 1; - } - call_glXSwapBuffers (dpy, drawable); - frames++; - if (frames % 60 == 0) { - double fps; - gettimeofday (&tv_now, NULL); - - fps = (double) frames / (tv_now.tv_sec - tv_start.tv_sec + - (tv_now.tv_usec - tv_start.tv_usec) / 1.0e6); - - printf("FPS: %.3f\n", fps); - } + glwrap_end_frame (); }