summaryrefslogtreecommitdiffstats
path: root/progs/xdemos
diff options
context:
space:
mode:
authorPauli Nieminen <suokkos@gmail.com>2009-08-03 12:05:33 -0700
committerBrian Paul <brianp@vmware.com>2009-08-03 13:42:05 -0600
commitfb7cf731f9028c1c53addb6c10c68bd4c1794ae6 (patch)
treed7a827c61c23c65fde5b0dea8707b6e891cdf6a2 /progs/xdemos
parentb59eb3b8b14a8973dd133cbc73949a0993d07fb6 (diff)
downloadexternal_mesa3d-fb7cf731f9028c1c53addb6c10c68bd4c1794ae6.zip
external_mesa3d-fb7cf731f9028c1c53addb6c10c68bd4c1794ae6.tar.gz
external_mesa3d-fb7cf731f9028c1c53addb6c10c68bd4c1794ae6.tar.bz2
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 <suokkos@gmail.com>
Diffstat (limited to 'progs/xdemos')
-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 5a5d084..8cdd560 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;