diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-08-25 15:07:33 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2016-08-29 10:11:52 +0000 |
commit | dcfb814498be938421b56020d7c9946cce7296dd (patch) | |
tree | 5bad6fab23d95768cf3ce1344e02c753e28f6216 /src/platformsupport/cglconvenience | |
parent | e52fcb7dc78c83586c813f55f087a98bae4eaa0e (diff) |
Cocoa: Add support for triple-buffered GL contexts
As usual, the requested format may not be available, so clients should
check the actual format to confirm triple-buffering.
Change-Id: Icf073cc9ddf2c912eb5c3ce0ac80d1694d1c56d7
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/platformsupport/cglconvenience')
-rw-r--r-- | src/platformsupport/cglconvenience/cglconvenience.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm index 6b0a91e13f..fb609ae485 100644 --- a/src/platformsupport/cglconvenience/cglconvenience.mm +++ b/src/platformsupport/cglconvenience/cglconvenience.mm @@ -81,8 +81,11 @@ void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format) QVector<NSOpenGLPixelFormatAttribute> attrs; - if (format.swapBehavior() != QSurfaceFormat::SingleBuffer) + if (format.swapBehavior() == QSurfaceFormat::DoubleBuffer + || format.swapBehavior() == QSurfaceFormat::DefaultSwapBehavior) attrs.append(NSOpenGLPFADoubleBuffer); + else if (format.swapBehavior() == QSurfaceFormat::TripleBuffer) + attrs.append(NSOpenGLPFATripleBuffer); #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { |