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:oubleBuffers 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-intere.../msg00313.html - it's Mac OS X specific unfortunately; I'll repeat it here for completeness:
This helps a little but the tearing is still present.Qt Code:
AGLContext aglContext; aglContext = aglGetCurrentContext(); GLint swapInt = 1; aglSetInteger(aglContext, AGL_SWAP_INTERVAL, &swapInt);To copy to clipboard, switch view to plain text mode
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.
Bookmarks