]> git.sesse.net Git - glcapture/commitdiff
Parametrize FPS.
authorsgunderson@bigfoot.com <>
Sat, 18 Jul 2009 18:18:42 +0000 (20:18 +0200)
committersgunderson@bigfoot.com <>
Sat, 18 Jul 2009 18:18:42 +0000 (20:18 +0200)
glcapture.c

index e4af4083f0b2ccaeeeb3daf0f2802716cad82cc0..54fee16415643de8dd2c671813b8abb5104b40d7 100644 (file)
@@ -19,6 +19,7 @@
 
 #define WIDTH 640
 #define HEIGHT 480
+#define FPS 50
 
 static char buf[WIDTH * HEIGHT * 3];
 static int frameno = 0;
@@ -53,7 +54,7 @@ void glXSwapBuffers( Display *dpy, GLXDrawable drawable )
 int gettimeofday(struct timeval *tv, struct timezone *tz)
 {
        printf("gettimeofday frame %u\n", frameno);
-       tv->tv_sec = frameno / 50;
-       tv->tv_usec = ((double)(frameno % 50) / 50) * 1000000;
+       tv->tv_sec = frameno / FPS;
+       tv->tv_usec = ((double)(frameno % FPS) / FPS) * 1000000;
        return 0;
 }