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:

committed by
Brian Paul

parent
b59eb3b8b1
commit
fb7cf731f9
@@ -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;
|
||||
|
Reference in New Issue
Block a user