Difference between GL implementation version and currently visible version

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Difference between GL implementation version and currently visible version

Martin
Hi,

I noticed that my macOS instanciate a GL4bcImpl (which seam to indicate that the device supports GL4), but that the version indicated by GL.getContext().getGLVersion() returns "2.1".

I am surprised by the second one - which is however consistent with string provided by GLXINFO :

OpenGL version string: 2.1 Metal - 71.6.4

All my macOS, even the youngest one return this 2.1 string - which would be surprising for Apple since OpenGL 4 has been released several years ago already (and is now deprecated).

Is there a different field that I should check to verify the max OpenGL supported version on macos?


System.out.println(drawable.getGL().getClass());
System.out.println(drawable.getGL().getContext().getGLVersion());
Reply | Threaded
Open this post in threaded view
|

Re: Difference between GL implementation version and currently visible version

Sven Gothel
Administrator
GL4bcImpl is just the glue-impl class for all mixed fixed/programmable pipelines - the super class if you will.
This way we reduce dummy code, i.e. we have additionally GLES3Impl .. all covered.

The chosen profile like GL2/GL3 is what matters.
Reply | Threaded
Open this post in threaded view
|

Re: Difference between GL implementation version and currently visible version

Martin
Thank you.

drawable.getGL().getGLProfile().getName() returns a GL2 profile

But this remains a bit hard to understand as most developers tend to claim that macOS supports GL4.1

Would this be possible that Metal API on macOS is at version2.1 and that GL_VERSION returns the Metal version rather than OpenGL version?

Reply | Threaded
Open this post in threaded view
|

Re: Difference between GL implementation version and currently visible version

gouessej
Administrator
You use a backward compatible profile, maybe the behaviour is different with a forward compatible profile.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Difference between GL implementation version and currently visible version

Sven Gothel
Administrator
In reply to this post by Martin
Use max programmable or just request an ES2 profile (lowest programmable) and the best will be returned.

Like GLProfile.get(GLProfile.GLES2);, if you like to skip the embedded world (lol),
try GLProfile.get(GLProfile.GL3); (for a core >= GL3 profile).

To get a fully comprehensible string of the used GLContext, try JoglVersion.getInstance().toString(context.getGL())

On MacOS, they support modern core profiles, but ended support for fixed function backward compatible, like GL2, GL3bc etc.

AFAIK, I documented all of this quite extensively in GLProfile ...

Also, please read
- Overview within userguide
- OpenGL Evolution & JOGL, incl. UML diagram of GLProfiles

Reply | Threaded
Open this post in threaded view
|

Re: Difference between GL implementation version and currently visible version

Martin
I was using max programmable but for fixed function pipeline so making this change allows retrieving a GL4.1 profile :

GLProfile profile = GLProfile.getMaxProgrammable(true);
//GLProfile profile = GLProfile.getMaxFixedFunc(true);

Thank you Sven and Julien for your suggestions.
Reply | Threaded
Open this post in threaded view
|

Re: Difference between GL implementation version and currently visible version

gouessej
Administrator
Ok but keep in mind that now, you can get a GL4 instance instead of a GL4bc instance, your source code must be fully ready to handle it. For example, you can't use methods coming from GL2 but absent from GL2ES2 as GL4 extends GL2ES2 but not GL2.
Julien Gouesse | Personal blog | Website