summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/cglconvenience/cglconvenience.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport/cglconvenience/cglconvenience.mm')
-rw-r--r--src/platformsupport/cglconvenience/cglconvenience.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm
index 5c57457e87..325f5c5770 100644
--- a/src/platformsupport/cglconvenience/cglconvenience.mm
+++ b/src/platformsupport/cglconvenience/cglconvenience.mm
@@ -89,6 +89,18 @@ 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 ) {
+ attrs << NSOpenGLPFAOpenGLProfile;
+ attrs << NSOpenGLProfileVersion3_2Core;
+ }
+#else
+ qWarning("Mac OSX >= 10.7 is needed for OpenGL Core Profile support");
+#endif
+ }
+
if (format.depthBufferSize() > 0)
attrs << NSOpenGLPFADepthSize << format.depthBufferSize();
if (format.stencilBufferSize() > 0)