summaryrefslogtreecommitdiffstats
path: root/progs
diff options
context:
space:
mode:
Diffstat (limited to 'progs')
-rw-r--r--progs/xdemos/glxcontexts.c3
-rw-r--r--progs/xdemos/glxswapcontrol.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/progs/xdemos/glxcontexts.c b/progs/xdemos/glxcontexts.c
index 481749be3d8..9f83679acd3 100644
--- a/progs/xdemos/glxcontexts.c
+++ b/progs/xdemos/glxcontexts.c
@@ -378,6 +378,9 @@ make_window( Display *dpy, const char *name,
scrnum = DefaultScreen( dpy );
root = RootWindow( dpy, scrnum );
+ if (visinfo)
+ XFree(visinfo);
+
visinfo = glXChooseVisual( dpy, scrnum, attribs );
if (!visinfo) {
printf("Error: couldn't get an RGB, Double-buffered visual\n");
diff --git a/progs/xdemos/glxswapcontrol.c b/progs/xdemos/glxswapcontrol.c
index df9f7ad784b..cd60d460a06 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;