PDA

View Full Version : QGLWidget tearing when drawing video



koan
9th October 2010, 16:24
I'm trying to render video on a GL quad using a QGLWidget but I am experiencing tearing in the video. I'm not an OpenGL expert.

I set the option QGL::DoubleBuffers in the constructor and the first thing I do is makeCurrent().

I try to synchronize the application frame rate to the monitor refresh rate, following the advice in http://lists.trolltech.com/qt-interest/2006-04/msg00313.html - it's Mac OS X specific unfortunately; I'll repeat it here for completeness:

AGLContext aglContext;
aglContext = aglGetCurrentContext();
GLint swapInt = 1;
aglSetInteger(aglContext, AGL_SWAP_INTERVAL, &swapInt);
This helps a little but the tearing is still present.

In the paintEvent I bind the next frame texture. I use a timerEvent to call update and then preload the next frame.

Any help gratefully appreciated.