summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/cglconvenience
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport/cglconvenience')
-rw-r--r--src/platformsupport/cglconvenience/cglconvenience.mm13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm
index 7ca9b6025e..3367373183 100644
--- a/src/platformsupport/cglconvenience/cglconvenience.mm
+++ b/src/platformsupport/cglconvenience/cglconvenience.mm
@@ -89,17 +89,22 @@ void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format)
attrs.append(NSOpenGLPFADoubleBuffer);
- if (format.profile() == QSurfaceFormat::CoreProfile) {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
- if ((format.majorVersion() == 3 && format.minorVersion() >= 2)
- || format.majorVersion() > 3 ) {
+ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
+ if (format.profile() == QSurfaceFormat::CoreProfile
+ && ((format.majorVersion() == 3 && format.minorVersion() >= 2)
+ || format.majorVersion() > 3)) {
attrs << NSOpenGLPFAOpenGLProfile;
attrs << NSOpenGLProfileVersion3_2Core;
+ } else {
+ attrs << NSOpenGLPFAOpenGLProfile;
+ attrs << NSOpenGLProfileVersionLegacy;
}
+ }
#else
+ if (format.profile() == QSurfaceFormat::CoreProfile)
qWarning("Mac OSX >= 10.7 is needed for OpenGL Core Profile support");
#endif
- }
if (format.depthBufferSize() > 0)
attrs << NSOpenGLPFADepthSize << format.depthBufferSize();