I am trying to set up an OpenGL 3.0+ context within XCode 4.
As you can see talking about shaders here at the developer website the example it uses is OpenGL 2.0. In Ap
There is some example code here for setting up an 3.2 context inside an NSOpenGLView.
Or using Core GL,
CGLPixelFormatAttribute attribs[13] = {
kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute)kCGLOGLPVersion_3_2_Core, // This sets the context to 3.2
kCGLPFAColorSize, (CGLPixelFormatAttribute)24,
kCGLPFAAlphaSize, (CGLPixelFormatAttribute)8,
kCGLPFAAccelerated,
kCGLPFADoubleBuffer,
kCGLPFASampleBuffers, (CGLPixelFormatAttribute)1,
kCGLPFASamples, (CGLPixelFormatAttribute)4,
(CGLPixelFormatAttribute)0
};
CGLPixelFormatObj pix;
GLint npix;
CGLChoosePixelFormat(attribs, &pix, &npix);
CGLContextObj ctx;
CGLCreateContext(pix, 0, &ctx);
CGLSetCurrentContext(ctx);
CGLLockContext(ctx);
In either case you have to do it manually(not through InterfaceBuilder) because it's opt-in.