xdemos/glsync: handle no sync method better
authorJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 4 Jan 2010 21:26:17 +0000 (16:26 -0500)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Fri, 8 Jan 2010 17:37:44 +0000 (12:37 -0500)
Print out count, finish rendering, etc.  Makes the -sn option more useful.

progs/xdemos/glsync.c

index 6108d991d01fdf3bd5ea66f6fb9634ae4eb5ba49..4dc49377039d806cb29846d353b457bd33ee688e 100644 (file)
@@ -117,8 +117,7 @@ int main(int argc, char *argv[])
        int dummy;
        Atom wmDelete;
        enum sync_type waitforsync = none;
-       int width = 500, height = 500, verbose = 0,
-               countonly = 0, interval = 1;
+       int width = 500, height = 500, verbose = 0, interval = 1;
        int c, i = 1;
        int ret;
        int attribs[] = { GLX_RGBA,
@@ -283,13 +282,10 @@ int main(int argc, char *argv[])
                        glFlush();
                } else if (waitforsync == buffer_swap) {
                        glXSwapBuffers(disp, winGL);
-               }
-
-               if (countonly) {
-                       video_sync(2, 1, &count);
-                       fprintf(stderr, "current count: %d\n", count);
+               } else {
+                       video_sync_get(&count);
                        sleep(1);
-                       continue;
+                       glFinish();
                }
 
                if (verbose) {