From 3d0ab3e6263dfdbb9dd0014443ad28b1c9b0c238 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 21 Dec 2013 22:03:47 +0100 Subject: Bug 929 - Reflect ES3 Compatibility with ES2 - Map ES2 -> ES3 GLProfile, if available - EGLDrawableFactory: Don't query ES2 if ES3 is available - Fix queries and get methods (GL, GLContext and GLProfile): - glES3.isGLES2()==true and glES3.getGLES2()!=null - ctxES3.isGLES2()==true, - glES3Profile.isGLES2()==true - Enhance Unit test: TestGLProfile01NEWT - Test all GLProfile availability combinations based on implementing GLProfile - Test all GLProfile's isGL*() based on highest GLProfile identity - Test all GL's isGL*() based on highest GL identity. --- src/jogl/classes/javax/media/opengl/GLContext.java | 10 +++++++--- src/jogl/classes/javax/media/opengl/GLProfile.java | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/jogl/classes/javax/media') diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java index deb1d7587..bec62c30d 100644 --- a/src/jogl/classes/javax/media/opengl/GLContext.java +++ b/src/jogl/classes/javax/media/opengl/GLContext.java @@ -1109,11 +1109,15 @@ public abstract class GLContext { } /** - * Indicates whether this GLContext is capable of GLES2.

Includes [ GLES2 ].

+ * Indicates whether this GLContext is capable of GLES2.

Includes [ GLES2, GLES3 ].

* @see GLProfile#isGLES2() */ public final boolean isGLES2() { - return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() == 2 ; + if( 0 != ( ctxOptions & CTX_PROFILE_ES ) ) { + final int major = ctxVersion.getMajor(); + return 2 == major || 3 == major; + } + return false; } /** @@ -1121,7 +1125,7 @@ public abstract class GLContext { * @see GLProfile#isGLES3() */ public final boolean isGLES3() { - return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 3 ; + return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() == 3 ; } /** diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 64c8a6243..1f9460f5d 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -1147,9 +1147,9 @@ public class GLProfile { return GLES1 == profile; } - /** Indicates whether this profile is capable of GLES2.

Includes [ GLES2 ].

*/ + /** Indicates whether this profile is capable of GLES2.

Includes [ GLES2, GLES3 ].

*/ public final boolean isGLES2() { - return GLES2 == profile; + return isGLES3() || GLES2 == profile; } /** Indicates whether this profile is capable of GLES3.

Includes [ GLES3 ].

*/ @@ -1157,7 +1157,7 @@ public class GLProfile { return GLES3 == profile; } - /** Indicates whether this profile is capable of GLES.

Includes [ GLES3, GLES1, GLES2 ].

*/ + /** Indicates whether this profile is capable of GLES.

Includes [ GLES1, GLES2, GLES3 ].

*/ public final boolean isGLES() { return GLES3 == profile || GLES2 == profile || GLES1 == profile; } -- cgit v1.2.3