summaryrefslogtreecommitdiffstats
path: root/src/glx/apple/apple_visual.c
diff options
context:
space:
mode:
authorJeremy Huddleston <[email protected]>2011-06-11 23:43:38 -0700
committerJeremy Huddleston <[email protected]>2011-06-11 23:43:38 -0700
commit9a00dd974699e369b1eb292103fbde8bc6adfb87 (patch)
tree9b450db290e39a076ad5b5fee6cb337455a0b1c2 /src/glx/apple/apple_visual.c
parentdf1dacf093058e74ec102d8828d2751a9ed6e34e (diff)
apple: Request OpenGL 3.2 from OpenGL.framework if available
Signed-off-by: Jeremy Huddleston <[email protected]>
Diffstat (limited to 'src/glx/apple/apple_visual.c')
-rw-r--r--src/glx/apple/apple_visual.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c
index 5a7fc325a31..a24616480ab 100644
--- a/src/glx/apple/apple_visual.c
+++ b/src/glx/apple/apple_visual.c
@@ -40,10 +40,19 @@
#include <OpenGL/OpenGL.h>
#include <OpenGL/CGLContext.h>
#include <OpenGL/CGLRenderers.h>
+#include <OpenGL/CGLTypes.h>
#undef glTexImage1D
#undef glTexImage2D
#undef glTexImage3D
+#ifndef kCGLPFAOpenGLProfile
+#define kCGLPFAOpenGLProfile 99
+#endif
+
+#ifndef kCGLOGLPVersion_3_2_Core
+#define kCGLOGLPVersion_3_2_Core 0x3200
+#endif
+
#include "apple_cgl.h"
#include "apple_visual.h"
#include "apple_glx.h"
@@ -64,6 +73,12 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m
GLint vsref = 0;
CGLError error = 0;
+ /* Request an OpenGL 3.2 profile if one is available */
+ if(apple_cgl.version_major > 1 || (apple_cgl.version_major == 1 && apple_cgl.version_minor >= 3)) {
+ attr[numattr++] = kCGLPFAOpenGLProfile;
+ attr[numattr++] = kCGLOGLPVersion_3_2_Core;
+ }
+
if (offscreen) {
apple_glx_diagnostic
("offscreen rendering enabled. Using kCGLPFAOffScreen\n");