aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-07-16 05:34:49 +0200
committerSven Gothel <[email protected]>2013-07-16 05:34:49 +0200
commit5dafc958385da595160dc0d3c843c8253334c3c5 (patch)
tree095cb24590a20a0731c4438cb2204523aeb95808
parent0002fccdcd6383874b2813dc6bbe3e33f5f00924 (diff)
GL*: Expose isGL*Core(); GLContext: isGL*() API doc cleanup - align queries.
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java15
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gles1.java15
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gles3.java15
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java12
-rw-r--r--src/jogl/classes/javax/media/opengl/GLBase.java18
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java44
6 files changed, 109 insertions, 10 deletions
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
index 5ac2837fa..6cec06d04 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
@@ -100,6 +100,21 @@ public final boolean isGL4ES3() {
}
@Override
+public final boolean isGL4core() {
+ return _context.isGL4core();
+}
+
+@Override
+public final boolean isGL3core() {
+ return _context.isGL3core();
+}
+
+@Override
+public final boolean isGLcore() {
+ return _context.isGLcore();
+}
+
+@Override
public final boolean isGLES2Compatible() {
return _context.isGLES2Compatible();
}
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java
index 2fa83dca6..35e8b0916 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java
@@ -78,6 +78,21 @@ public final boolean isGL4ES3() {
}
@Override
+public final boolean isGL4core() {
+ return false;
+}
+
+@Override
+public final boolean isGL3core() {
+ return false;
+}
+
+@Override
+public final boolean isGLcore() {
+ return false;
+}
+
+@Override
public final boolean isGLES2Compatible() {
return false;
}
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles3.java b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
index bb4a6246b..a03352409 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
@@ -79,6 +79,21 @@ public final boolean isGL4ES3() {
}
@Override
+public final boolean isGL4core() {
+ return false;
+}
+
+@Override
+public final boolean isGL3core() {
+ return false;
+}
+
+@Override
+public final boolean isGLcore() {
+ return true;
+}
+
+@Override
public final boolean isGLES2Compatible() {
return true;
}
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
index 7659238fc..262fed934 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
@@ -669,6 +669,18 @@ public class BuildComposablePipeline {
emitGLIsMethod(output, "GLES");
}
output.println(" @Override");
+ output.println(" public final boolean isGL4core() {");
+ output.println(" return " + getDownstreamObjectName() + ".isGL4core();");
+ output.println(" }");
+ output.println(" @Override");
+ output.println(" public final boolean isGL3core() {");
+ output.println(" return " + getDownstreamObjectName() + ".isGL3core();");
+ output.println(" }");
+ output.println(" @Override");
+ output.println(" public final boolean isGLcore() {");
+ output.println(" return " + getDownstreamObjectName() + ".isGLcore();");
+ output.println(" }");
+ output.println(" @Override");
output.println(" public final boolean isGLES2Compatible() {");
output.println(" return " + getDownstreamObjectName() + ".isGLES2Compatible();");
output.println(" }");
diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java
index fcfe34132..3e578dc68 100644
--- a/src/jogl/classes/javax/media/opengl/GLBase.java
+++ b/src/jogl/classes/javax/media/opengl/GLBase.java
@@ -185,6 +185,24 @@ public interface GLBase {
*/
public boolean isGL2GL3();
+ /**
+ * Indicates whether this GL object uses a GL4 core profile. <p>Includes [ GL4 ].</p>
+ * @see GLContext#isGL4core()
+ */
+ public boolean isGL4core();
+
+ /**
+ * Indicates whether this GL object uses a GL3 core profile. <p>Includes [ GL4, GL3 ].</p>
+ * @see GLContext#isGL3core()
+ */
+ public boolean isGL3core();
+
+ /**
+ * Indicates whether this GL object uses a GL core profile. <p>Includes [ GL4, GL3, GLES3, GL2ES2 ].</p>
+ * @see GLContext#isGLcore()
+ */
+ public boolean isGLcore();
+
/**
* Indicates whether this GL object is compatible with the core OpenGL ES2 functionality.
* @return true if this context is an ES2 context or implements
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index d94531221..c3e82e6ee 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -934,8 +934,9 @@ public abstract class GLContext {
* @see GLProfile#isGL4bc()
*/
public final boolean isGL4bc() {
- return ctxVersion.getMajor() >= 4 && 0 != (ctxOptions & CTX_IS_ARB_CREATED)
- && 0 != (ctxOptions & CTX_PROFILE_COMPAT);
+ return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
+ 0 != (ctxOptions & CTX_PROFILE_COMPAT) &&
+ ctxVersion.getMajor() >= 4;
}
/**
@@ -943,16 +944,18 @@ public abstract class GLContext {
* @see GLProfile#isGL4()
*/
public final boolean isGL4() {
- return ctxVersion.getMajor() >= 4 && 0 != (ctxOptions & CTX_IS_ARB_CREATED)
- && 0 != (ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_CORE));
+ return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
+ 0 != (ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_CORE)) &&
+ ctxVersion.getMajor() >= 4;
}
/**
- * Indicates whether this GLContext is capable of GL4 (core only). <p>Includes [ GL4 ].</p>
+ * Indicates whether this GLContext uses a GL4 core profile. <p>Includes [ GL4 ].</p>
*/
public final boolean isGL4core() {
- return ctxVersion.getMajor() >= 4 && 0 != (ctxOptions & CTX_IS_ARB_CREATED)
- && 0 != (ctxOptions & CTX_PROFILE_CORE);
+ return 0 != ( ctxOptions & CTX_IS_ARB_CREATED ) &&
+ 0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
+ ctxVersion.getMajor() >= 4;
}
/**
@@ -973,10 +976,10 @@ public abstract class GLContext {
return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
0 != (ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_CORE)) &&
ctxVersion.compareTo(Version310) >= 0 ;
- }
+ }
/**
- * Indicates whether this GLContext is capable of GL3 (core only). GL3 starts w/ OpenGL 3.1 <p>Includes [ GL4, GL3 ].</p>
+ * Indicates whether this GLContext uses a GL3 core profile. <p>Includes [ GL4, GL3 ].</p>
*/
public final boolean isGL3core() {
return 0 != ( ctxOptions & CTX_IS_ARB_CREATED ) &&
@@ -985,6 +988,17 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext uses a GL core profile. <p>Includes [ GL4, GL3, GLES3, GL2ES2 ].</p>
+ */
+ public final boolean isGLcore() {
+ return ( 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 2 ) ||
+ ( 0 != ( ctxOptions & CTX_IS_ARB_CREATED ) &&
+ 0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
+ ctxVersion.compareTo(Version310) >= 0
+ ) ;
+ }
+
+ /**
* Indicates whether this GLContext's native profile does not implement a default <i>vertex array object</i> (VAO),
* starting w/ OpenGL 3.1 core and GLES3.
* <p>Includes [ GL4, GL3, GLES3 ].</p>
@@ -1029,6 +1043,7 @@ public abstract class GLContext {
public abstract int getDefaultVAO();
/**
+ * Indicates whether this GLContext is capable of GL2. <p>Includes [ GL4bc, GL3bc, GL2 ].</p>
* @see GLProfile#isGL2()
*/
public final boolean isGL2() {
@@ -1036,6 +1051,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GL2GL3. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GL2, GL2GL3 ].</p>
* @see GLProfile#isGL2GL3()
*/
public final boolean isGL2GL3() {
@@ -1043,13 +1059,15 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GLES1. <p>Includes [ GLES1 ].</p>
* @see GLProfile#isGLES1()
*/
public final boolean isGLES1() {
return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() == 1 ;
}
- /**
+ /**
+ * Indicates whether this GLContext is capable of GLES2. <p>Includes [ GLES3, GLES2 ].</p>
* @see GLProfile#isGLES2()
*/
public final boolean isGLES2() {
@@ -1057,6 +1075,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GLES3. <p>Includes [ GLES3 ].</p>
* @see GLProfile#isGLES3()
*/
public final boolean isGLES3() {
@@ -1064,6 +1083,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GLES. <p>Includes [ GLES3, GLES1, GLES2 ].</p>
* @see GLProfile#isGLES()
*/
public final boolean isGLES() {
@@ -1071,6 +1091,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GL2ES1. <p>Includes [ GL4bc, GL3bc, GL2, GLES1, GL2ES1 ].</p>
* @see GLProfile#isGL2ES1()
*/
public final boolean isGL2ES1() {
@@ -1078,6 +1099,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GL2ES2. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GLES3, GL2, GL2GL3, GL2ES2, GLES2 ].</p>
* @see GLProfile#isGL2ES2()
*/
public final boolean isGL2ES2() {
@@ -1085,6 +1107,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GL3ES3. <p>Includes [ GL4bc, GL4, GL3bc, GL3, GLES3 ].</p>
* @see GLProfile#isGL3ES3()
*/
public final boolean isGL3ES3() {
@@ -1092,6 +1115,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this profile is capable of GL4ES3. <p>Includes [ GL4bc, GL4, GLES3 ].</p>
* @see GLProfile#isGL4ES3()
*/
public final boolean isGL4ES3() {