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>
This commit is contained in:
Samuel Rødal 2013-02-05 08:31:29 +01:00 committed by The Qt Project
parent 328c7ee6b8
commit ef7c9b5b52
2 changed files with 3 additions and 2 deletions

View File

@ -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())

View File

@ -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) {