Merge branch '7.8' into master
[mesa.git] / progs / xdemos / glxswapcontrol.c
index 2c518019896925091fed832e5bea060acdaa95f4..cd60d460a061e3243fa144f78786f7c407d918c5 100644 (file)
@@ -303,13 +303,13 @@ draw(void)
       glDisable(GL_LIGHTING);
       glShadeModel(GL_SMOOTH);
 
-      glEnable( GL_VERTEX_ARRAY );
-      glEnable( GL_COLOR_ARRAY );
+      glEnableClientState( GL_VERTEX_ARRAY );
+      glEnableClientState( GL_COLOR_ARRAY );
       glVertexPointer( 3, GL_FLOAT, 0, vert );
       glColorPointer( 3, GL_FLOAT, 0, col );
       glDrawArrays( GL_POLYGON, 0, 4 );
-      glDisable( GL_COLOR_ARRAY );
-      glDisable( GL_VERTEX_ARRAY );
+      glDisableClientState( GL_COLOR_ARRAY );
+      glDisableClientState( GL_VERTEX_ARRAY );
 
       glMatrixMode(GL_PROJECTION);
       glLoadIdentity();
@@ -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;
@@ -759,7 +760,7 @@ main(int argc, char *argv[])
    Display *dpy;
    Window win;
    GLXContext ctx;
-   char *dpyName = ":0";
+   char *dpyName = NULL;
    int swap_interval = 1;
    GLboolean do_swap_interval = GL_FALSE;
    GLboolean force_get_rate = GL_FALSE;