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>
This commit is contained in:
Pauli Nieminen
2009-08-03 12:05:33 -07:00
committed by Brian Paul
parent b59eb3b8b1
commit fb7cf731f9

View File

@@ -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;