summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@digia.com>2013-02-05 08:31:29 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-05 09:00:56 +0100
commitef7c9b5b525c539d12d17f61b979c1c4e0751076 (patch)
tree2ef083769f92754a55e530fdada6186d20e1cf95 /src
parent328c7ee6b804043a6fe293bcd0afba7d715989f7 (diff)
Fixed missing support for single buffered OpenGL on OS X.
Task-number: QTBUG-28804 Change-Id: I426a9bbc08953d777f67a23b050570e9f7d442d7 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qgl_qpa.cpp2
-rw-r--r--src/platformsupport/cglconvenience/cglconvenience.mm3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index 44df7d109c..0a24654624 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -100,7 +100,7 @@ QSurfaceFormat QGLFormat::toSurfaceFormat(const QGLFormat &format)
retFormat.setRedBufferSize(format.redBufferSize());
if (format.depth())
retFormat.setDepthBufferSize(format.depthBufferSize() == -1 ? 1 : format.depthBufferSize());
- retFormat.setSwapBehavior(format.doubleBuffer() ? QSurfaceFormat::DoubleBuffer : QSurfaceFormat::DefaultSwapBehavior);
+ retFormat.setSwapBehavior(format.doubleBuffer() ? QSurfaceFormat::DoubleBuffer : QSurfaceFormat::SingleBuffer);
if (format.sampleBuffers())
retFormat.setSamples(format.samples() == -1 ? 4 : format.samples());
if (format.stencil())
diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm
index dbb453f1b5..b0ea2d2225 100644
--- a/src/platformsupport/cglconvenience/cglconvenience.mm
+++ b/src/platformsupport/cglconvenience/cglconvenience.mm
@@ -87,7 +87,8 @@ void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format)
QVector<NSOpenGLPixelFormatAttribute> attrs;
- attrs.append(NSOpenGLPFADoubleBuffer);
+ if (format.swapBehavior() != QSurfaceFormat::SingleBuffer)
+ attrs.append(NSOpenGLPFADoubleBuffer);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {