summaryrefslogtreecommitdiffstats
path: root/progs/xdemos/glxswapcontrol.c
diff options
context:
space:
mode:
authorPauli Nieminen <[email protected]>2009-08-03 12:05:33 -0700
committerBrian Paul <[email protected]>2009-08-03 13:42:05 -0600
commitfb7cf731f9028c1c53addb6c10c68bd4c1794ae6 (patch)
treed7a827c61c23c65fde5b0dea8707b6e891cdf6a2 /progs/xdemos/glxswapcontrol.c
parentb59eb3b8b14a8973dd133cbc73949a0993d07fb6 (diff)
xdemo/glxswapcontrol: Move get_framge_usage after the swap.
This fixes the problem that first frame would report bogus usage values. Problem was caused because get_frame_usage returned data from previous buffer swap. Signed-off-by: Pauli Nieminen <[email protected]>
Diffstat (limited to 'progs/xdemos/glxswapcontrol.c')
-rw-r--r--progs/xdemos/glxswapcontrol.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/progs/xdemos/glxswapcontrol.c b/progs/xdemos/glxswapcontrol.c
index 5a5d084f909..8cdd560207e 100644
--- a/progs/xdemos/glxswapcontrol.c
+++ b/progs/xdemos/glxswapcontrol.c
@@ -587,6 +587,9 @@ event_loop(Display *dpy, Window win)
angle += 2.0;
draw();
+
+ glXSwapBuffers(dpy, win);
+
if ( get_frame_usage != NULL ) {
GLfloat temp;
@@ -594,8 +597,6 @@ event_loop(Display *dpy, Window win)
frame_usage += temp;
}
- glXSwapBuffers(dpy, win);
-
/* calc framerate */
{
static int t0 = -1;