Use glFlush() if swapBehavior is single-buffered

Otherwise, use swapBuffers()

This fixes an issue where swapbuffers() did not swap the
"back buffer" to the "front buffer" if we had single-buffered swap
behavior.
This was an issue on Windows 7 with an NVIDIA graphics card that
by default was using single-buffered mode.

Change-Id: If53f54146e4633305be3ad5158565752b6516b59
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Jan-Arve Saether 2012-07-30 14:21:15 +02:00 committed by Qt by Nokia
parent 0e3dcf3624
commit 8632b26285

View File

@ -567,7 +567,8 @@ void QOpenGLContext::swapBuffers(QSurface *surface)
if (framebufferBinding != platformFramebuffer)
qWarning() << "QOpenGLContext::swapBuffers() called with non-default framebuffer object bound";
#endif
if (surface->format().swapBehavior() == QSurfaceFormat::SingleBuffer)
glFlush();
d->platformGLContext->swapBuffers(surfaceHandle);
}