diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-08-31 19:42:31 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2016-09-19 00:42:23 +0000 |
commit | 44fec65624d3569144e40b394af499172c81a7a9 (patch) | |
tree | 9d2fe6c0ae83a72a7f4cae2a389e43cc5af3fe18 /src/plugins | |
parent | 6ce96fdbf59138bebadbd8157d8285327a1a3796 (diff) |
Update swap interval of QCocoaGLContext after creation
QSurfaceFormat is recreated from scratch, and by not reading back the
swap interval the QCocoaGLContext seemed to be vsynced even if it
actually was not.
Change-Id: I72ddaae9a4c695fe4c74d7b4b70ca9db84bcc084
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaglcontext.mm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index b77ca07141..4ae81ef3ab 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -323,6 +323,11 @@ void QCocoaGLContext::updateSurfaceFormat() [pixelFormat release]; + GLint swapInterval = -1; + [m_context getValues:&swapInterval forParameter:NSOpenGLCPSwapInterval]; + if (swapInterval >= 0) + m_format.setSwapInterval(swapInterval); + // Restore the original context CGLSetCurrentContext(oldContext); } |