GL Version check behavior clarification

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

GL Version check behavior clarification

bgroenks96
So if we do GLContext.getCurrentGL().isGLxxx, what exactly is that supposed to be verifying?  That the particular set of libraries is supported?  Or that the requested GL version is/isn't the correct one for the current platform?

I ask because I'm a little confused as to why I'm getting true for isGLES2() on a Linux desktop machine.
Reply | Threaded
Open this post in threaded view
|

Re: GL Version check behavior clarification

gouessej
Administrator
Hi

You should look at the source code and in the wiki:
https://github.com/sgothel/jogl/blob/master/src/jogl/classes/javax/media/opengl/GLBase.java#L138
http://jogamp.org/jogl/doc/Overview-OpenGL-Evolution-And-JOGL.html

I'm under Linux and isGL2ES2() returns true but not isGLES2(). It depends on which profile you use.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GL Version check behavior clarification

bgroenks96
I think I'm using a GL2 profile by default.

The comment on that source method indicates that it shouldn't return true for desktop profiles that are ES compatible.  So why would it return true on my system?
Reply | Threaded
Open this post in threaded view
|

Re: GL Version check behavior clarification

Sven Gothel
Administrator
On 06/28/2014 04:31 AM, bgroenks96 [via jogamp] wrote:
> I think I'm using a GL2 profile by default.
>
> The comment on that source method indicates that it shouldn't return true for
> desktop profiles that are ES compatible.  So why would it return true on my
> system?

If you have a GL2 context, and isGLES2() returns true it is an error,
since this would lead software to believe you have an ES (embedded system)
context.

This would be a bug, which I cannot confirm.

However, it could be that you do use an ES profile even on desktop,
i.e. via Mesa or NV driver - which can deliver you an ES3 context.

~Sven



signature.asc (894 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GL Version check behavior clarification

bgroenks96
The driver I'm using on Linux is a Nvidia proprietary driver.

Would you expect that to deliver an ES context?  Or more specifically, would you expect isGLES2() to return true?
Reply | Threaded
Open this post in threaded view
|

Re: GL Version check behavior clarification

Sven Gothel
Administrator
On 06/29/2014 02:04 AM, bgroenks96 [via jogamp] wrote:
> The driver I'm using on Linux is a Nvidia proprietary driver.
>
> Would you expect that to deliver an ES context?  
Well, they can deliver an ES3 context.

If you request an ES profile, yes.

> Or more specifically, would
> you expect isGLES2() to return true?

Here, w/ NV driver on X11:
 > java com.jogamp.newt.opengl.GLWindow
GL Profile     GLProfile[GL4bc/GL4bc.hw]
GL Version     4.4 (Compat profile, arb, ES2 compat, ES3 compat, FBO, hardware) - 4.4.0 NVIDIA 337.19 [GL 4.4.0, vendor 337.19.0 (NVIDIA 337.19)]

 > java com.jogamp.newt.opengl.GLWindow -es2
GL Profile     GLProfile[GLES2/GLES3.hw]
GL Version     3.1 (ES profile, ES2 compat, ES3 compat, FBO, hardware) - OpenGL ES 3.1 337.19 [GL 3.1.0, vendor 337.19.0 (337.19)]

The item 'ES profile' in the 'GL Version' string indicates
that bit GLContext.CTX_PROFILE_ES is set in GLContext
which is required to return true for GLContext.isES2().

~Sven


signature.asc (894 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GL Version check behavior clarification

bgroenks96
Ok!

So what is the best way then to find the system's preferred profile?  I would guess the isGLxx methods aren't because they indicate compatibility rather than actual GL version?