From fb7cf731f9028c1c53addb6c10c68bd4c1794ae6 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Mon, 3 Aug 2009 12:05:33 -0700 Subject: [PATCH] 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 --- progs/xdemos/glxswapcontrol.c | 5 +++-- 1 file 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; -- 2.30.2