Archive for January, 2009

Avoiding OpenGL frame tearing on OS X

If you are writing OpenGL code for OS X and you are using NSOpenGL or CGL (Core OpenGL), you may notice you get frame tearing (meaning you can see the view port updating with the naked eye) even if you are using glutSwapBuffers.

The solution is to set a CGL option that syncs the vsynch to the current display frame rate so that you avoid tearing. In your drawing code, just before your glFlush (or equivalent), add the following code:

GLint swapInterval = 1;
CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &swapInterval);

Installing Trac on Apache with mod_python

New pictures