xdemos/glsync: handle no sync method better

Print out count, finish rendering, etc.  Makes the -sn option more useful.
This commit is contained in:
Jesse Barnes
2010-01-04 16:26:17 -05:00
parent 0269dc19b5
commit c642f3941b

View File

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