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>
This commit is contained in:
parent
6ce96fdbf5
commit
44fec65624
@ -323,6 +323,11 @@ void QCocoaGLContext::updateSurfaceFormat()
|
|||||||
|
|
||||||
[pixelFormat release];
|
[pixelFormat release];
|
||||||
|
|
||||||
|
GLint swapInterval = -1;
|
||||||
|
[m_context getValues:&swapInterval forParameter:NSOpenGLCPSwapInterval];
|
||||||
|
if (swapInterval >= 0)
|
||||||
|
m_format.setSwapInterval(swapInterval);
|
||||||
|
|
||||||
// Restore the original context
|
// Restore the original context
|
||||||
CGLSetCurrentContext(oldContext);
|
CGLSetCurrentContext(oldContext);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user