Vertical sync and swap buffers

when using the accelerated nvidia drivers,
it looks to me like the swap buffers are
not sync’d with the vertical retrace. does
anyone know if there is a driver option
to tie these things together?

in the following example,
if i use the X11 only version of Mesa
i get a fairly smooth animation without
any ripping. when using the nvidia drivers
i get a considerable amount of ripping.

thanks,

simple example:

#include <GL/gl.h>
#include <GL/glut.h>

void display ()
{
static int counter=0;
float x = (counter % 50) * .01;
glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
glVertex3f (x, 0.25, 0.0);
glVertex3f (x+0.50, 0.25, 0.0);
glVertex3f (x+0.50, 0.75, 0.0);
glVertex3f (x, 0.75, 0.0);
glEnd();
glutSwapBuffers ();
counter++;
glutPostRedisplay ();
}

void init (void)
{
/* select clearing (background) color */
glClearColor (0.0, 0.0, 0.0, 0.0);

/*  initialize viewing values  */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);

}

int main (int argc, char** argv)
{
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize (750, 500);
glutInitWindowPosition (100, 100);
glutCreateWindow (“test opengl”);
init();
glutDisplayFunc (display);
glutMainLoop ();
return 0;
}

setenv __GL_SYNC_TO_VBLANK 1

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.