Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.1.1
-
None
-
Mac OS 10.8.5. Effects all Mac OS systems.
-
-
8212e0cfad754d65146a21c95f38deaac8ffe8e1
Description
Creating a QGLWidget using a QGLFormat with setStereo(true) does not even try to create a stereo OpenGL on Mac OS. And the widget then reports that it does support stereo (w.format().stereo() -> true).
The broken code is
qtbase/src/platformsupport/cglconvenience/cglconvenience.mm
where the routine that chooses the Mac OpenGL pixel format qcgl_createNSOpenGLPixelFormat() simply ignores the stereo setting. The code which records the QGLFormat properties of the actual OpenGL context obtained qtbase/src/plugins/platforms/cocoa/qcocoaglcontext.mm, routine QCocoaGLContext::QCocoaGLContext() also ignores the OpenGL context and simply says the format exactly matches the requested format.
I've provided a patch that fixes the problem. It tries to get a stereo OpenGL context when the QGLFormat requests one, and if stereo is not supported provides a mono OpenGL context. Also the patch code will report the actual properties of the OpenGL context that was obtained.