The way the NativeContext is set up on OS X right now is only allowing me to get a context with version 2.1. The NSOpenGLPFAOpenGLProfile attribute needs to be specified in order to get a 3.2 core context. For now I’m simply doing the following:
juce_OpenGL_osx.h Line 114
NSOpenGLPixelFormatAttribute attribs[] =
{
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAMPSafe,
NSOpenGLPFAClosestPolicy,
NSOpenGLPFANoRecovery,
NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute) (pixFormat.redBits + pixFormat.greenBits + pixFormat.blueBits),
NSOpenGLPFAAlphaSize, (NSOpenGLPixelFormatAttribute) pixFormat.alphaBits,
NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute) pixFormat.depthBufferBits,
NSOpenGLPFAStencilSize, (NSOpenGLPixelFormatAttribute) pixFormat.stencilBufferBits,
NSOpenGLPFAAccumSize, (NSOpenGLPixelFormatAttribute) (pixFormat.accumulationBufferRedBits + pixFormat.accumulationBufferGreenBits
+ pixFormat.accumulationBufferBlueBits + pixFormat.accumulationBufferAlphaBits),
pixFormat.multisamplingLevel > 0 ? NSOpenGLPFASamples : (NSOpenGLPixelFormatAttribute) 0, (NSOpenGLPixelFormatAttribute) pixFormat.multisamplingLevel,
NSOpenGLPFAOpenGLProfile, (NSOpenGLPixelFormatAttribute) NSOpenGLProfileVersion3_2Core, // get a 3.2 core context
0
};
Some sort of mechanism to choose a context profile and version would be pretty nice. OpenGL on OS X right now only allows NSOpenGLProfileVersion3_2Core and NSOpenGLProfileVersionLegacy but in the probably not so near future, I’m assuming it will be able to target a specific version like on Windows.
