Specify OpenGL version

Is there a way to specify the version of OpenGL to use by TGLWidget / TGLContext, if possible without modifying the ROOT source code? I’m running ROOT on OS X, where OpenGL defaults to an older version.

I think the config file should tell you where OpenGL is searched. The configure command will tell you which one was found.

I mean the version of the OpenGL context, for example in GLFW there are hints that indicate which version is needed and they are passed to the underlying system API for context creation: http://www.glfw.org/docs/latest/window.html#window_hints_ctx

Hmmh, I don’t think you can tell context creation which version of GL you’re going to use, at least not on X11. On OSX you should get the Apple provided GL if you use --enable-cocoa (I thought this is the default in latest roots). Otherwise you get what comes with XQuartz, it’s 2.1 on my mac.

What root version are you using?

Yes it is.

Version 6.02/04

It seems the NSOpenGL pixel format attributes (contains profile version) are set up in graf2d/cocoa/src/TGCocoa.mm:3198 (CreateOpenGLWindow).
I’m trying to recompile ROOT, with the additional attributes

attribs.push_back(NSOpenGLPFAOpenGLProfile); attribs.push_back( (NSOpenGLPixelFormatAttribute) NSOpenGLProfileVersion3_2Core );

Update
Is working, but there seems to be no way to do it without modifying the framework or reimplementing context creation.