summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-07-31 19:25:13 +0200
committerSven Gothel <[email protected]>2011-07-31 19:25:13 +0200
commitc1c8dcbb0d51e4e2a902db129e5a6991d84c5fc9 (patch)
treefe6e090ba13d84b276b4141d8d75965d06af26e4 /src/jogl/classes/javax/media
parenta7bd295f0fd5740833a0c2fb55c474d995f65819 (diff)
JOGL: Add GLBase::isGLES2Compatible()
Indicates whether this GL object is compatible with OpenGL ES2, i.e. has the extension <code>GL_ARB_ES2_compatibility</code>
Diffstat (limited to 'src/jogl/classes/javax/media')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLBase.java7
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java20
2 files changed, 22 insertions, 5 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java
index 90b320ed3..f93d443e0 100644
--- a/src/jogl/classes/javax/media/opengl/GLBase.java
+++ b/src/jogl/classes/javax/media/opengl/GLBase.java
@@ -154,6 +154,13 @@ public interface GLBase {
public boolean isGL2ES2();
/**
+ * Indicates whether this GL object is compatible with OpenGL ES2.
+ * @return true if this context is an ES2 context or implements
+ * the extension <code>GL_ARB_ES2_compatibility</code>, otherwise false
+ */
+ public boolean isGLES2Compatible();
+
+ /**
* Indicates whether this GL object conforms to the GL2GL3 compatible profile.
* @return whether this GL object conforms to the GL2GL3 profile
*/
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index 30cc9c2ea..766533aab 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -88,7 +88,9 @@ public abstract class GLContext {
/** <code>ARB_create_context</code> related: flag not forward compatible */
protected static final int CTX_OPTION_ANY = 1 << 5;
/** <code>ARB_create_context</code> related: flag debug */
- public static final int CTX_OPTION_DEBUG = 1 << 6;
+ public static final int CTX_OPTION_DEBUG = 1 << 6;
+ /** <code>GL_ARB_ES2_compatibility</code> related: Context is compatible w/ ES2 */
+ protected static final int CTX_PROFILE_ES2_COMPAT = 1 << 8;
/** GLContext {@link com.jogamp.gluegen.runtime.ProcAddressTable} caching related: GL software implementation */
protected static final int CTX_IMPL_ACCEL_SOFT = 1 << 0;
@@ -416,7 +418,6 @@ public abstract class GLContext {
public final int getGLVersionMinor() { return ctxMinorVersion; }
public final boolean isGLCompatibilityProfile() { return ( 0 != ( CTX_PROFILE_COMPAT & ctxOptions ) ); }
public final boolean isGLCoreProfile() { return ( 0 != ( CTX_PROFILE_CORE & ctxOptions ) ); }
- public final boolean isGLEmbeddedProfile() { return ( 0 != ( CTX_PROFILE_ES & ctxOptions ) ); }
public final boolean isGLForwardCompatible() { return ( 0 != ( CTX_OPTION_FORWARD & ctxOptions ) ); }
public final boolean isCreatedWithARBMethod() { return ( 0 != ( CTX_IS_ARB_CREATED & ctxOptions ) ); }
@@ -508,15 +509,15 @@ public abstract class GLContext {
}
public final boolean isGLES1() {
- return ctxMajorVersion==1 && 0!=(ctxOptions & CTX_PROFILE_ES);
+ return ctxMajorVersion==1 && 0 != ( ctxOptions & CTX_PROFILE_ES ) ;
}
public final boolean isGLES2() {
- return ctxMajorVersion==2 && 0!=(ctxOptions & CTX_PROFILE_ES);
+ return ctxMajorVersion==2 && 0 != ( ctxOptions & CTX_PROFILE_ES ) ;
}
public final boolean isGLES() {
- return isGLEmbeddedProfile();
+ return 0 != ( CTX_PROFILE_ES & ctxOptions ) ;
}
public final boolean isGL2ES1() {
@@ -527,6 +528,14 @@ public abstract class GLContext {
return isGL2GL3() || isGLES2() ;
}
+ /**
+ * @return true if this context is an ES2 context or implements
+ * the extension <code>GL_ARB_ES2_compatibility</code>, otherwise false
+ */
+ public final boolean isGLES2Compatible() {
+ return 0 != ( ctxOptions & CTX_PROFILE_ES2_COMPAT ) ;
+ }
+
public final boolean hasGLSL() {
return isGL2ES2() ;
}
@@ -861,6 +870,7 @@ public abstract class GLContext {
sb.append(minor);
sb.append(" (");
needColon = appendString(sb, "ES", needColon, 0 != ( CTX_PROFILE_ES & ctp ));
+ needColon = appendString(sb, "ES2 compatible", needColon, 0 != ( CTX_PROFILE_ES2_COMPAT & ctp ));
needColon = appendString(sb, "compatibility profile", needColon, 0 != ( CTX_PROFILE_COMPAT & ctp ));
needColon = appendString(sb, "core profile", needColon, 0 != ( CTX_PROFILE_CORE & ctp ));
needColon = appendString(sb, "forward compatible", needColon, 0 != ( CTX_OPTION_FORWARD & ctp ));