summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan-Arve Saether <jan-arve.saether@nokia.com>2012-07-30 14:21:15 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-02 20:41:18 +0200
commit8632b262855585c750d43090dc4e1672370cc596 (patch)
treef62e3a4636e1f561bec4336859303ef7e8e70d02 /src
parent0e3dcf362460a2e4457f7059343d9720638360b8 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qopenglcontext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index ffb0726c35..d476278a7d 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -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);
}