From 8632b262855585c750d43090dc4e1672370cc596 Mon Sep 17 00:00:00 2001 From: Jan-Arve Saether Date: Mon, 30 Jul 2012 14:21:15 +0200 Subject: Use glFlush() if swapBehavior is single-buffered MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gui/kernel/qopenglcontext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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); } -- cgit v1.2.3