From 3a0d7703da32e9a5ddf08a334f18588a78038d88 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Mon, 15 Jul 2013 13:39:22 +0200
Subject: Add Support for GL 4.3 (Bug 716) and ES 3.0 (Bug 717)
ES3 / GL4.3:
- Update all EGL, GLX, WGL and GL (desktop and mobile) khronos headers to latest version.
- GL3/gl3* -> GL/glcorearb*
- Explicitly preserve ES2_compatibility and ES3_compatibility in header,
most extension grouping was removed in new headers.
- Always load all GLHeader to ensure proper extension association across all profiles.
- Unified method signatures
- Added GL_EXT_map_buffer_range to core
- Using common 'glMapBufferImpl(..)' for all glMapBuffer(..) and glMapBufferRange(..) impl.
- Init necessary fields of GL instances via 'finalizeInit()' called by reflection, if exist.
This allows removing initialization checks, i.e. for all buffer validations.
- BuildStaticGLInfo: Can handle new GL header structure, i.e. one CPP extenstion block incl. define + funcs.
- GLJavaMethodBindingEmitter: Simply print the
- No GL duplication due to new intermediate interfaces, see below
- OO lineare inheritance (Added GL2ES3, GL3ES3 and GL4ES3 intemediates):
GLBase - GL - GL2ES2 - GLES2
GLBase - GL - GL2ES2 - GL2GL3 - [ GL2, GL3 ]
GLBase - GL - GL2ES2 - GL2ES3 - GL3ES3 - [ GL3 ]
GLBase - GL - GL2ES2 - GL2ES3 - GL3ES3 - GL4ES3 - [ GLES3, GL4, .. ]
- Expose 'usable' intermediate interfaces GL3ES3 and GL4ES3 in GLBase/GLProfile/GLContext
via is*() and get*().
- GLContext*:
- isGL3core() is true if [ GL4, GL3, GLES3 ] (added GLES3)
- Added ctxProfile argument to allow handling ES versions:
- getMaxMajor(..), getMaxMinor(..), isValidGLVersion(..) and decrementGLVersion(..)
- mapGLVersions(..) prepared for ES ARB/KHR validation
- EGLContext checks ES3 (via old ctx's GL_VERSION)
- ExtensionAvailabilityCache adds GL_ES_Version_X_Y for ES.
- Prelim tests w/ Mesa 9.1.3
GL Version 3.0 (ES profile, ES2 compat, ES3 compat, FBO, hardware) - OpenGL ES 3.0 Mesa 9.1.3 [GL 3.0.0, vendor 9.1.3 (Mesa 9.1.3)]
- TODO:
- Use KHR_create_context in EGLContext.createContextARBImpl(..)
- More tests (Mobile, ..)
+++
Misc:
- GLContext*:
- Complete glAllocateMemoryNV w/ glFreeMemoryNV.
---
make/config/jogl/gl-impl-CustomJavaCode-gles3.java | 320 +++++++++++++++++++++
1 file changed, 320 insertions(+)
create mode 100644 make/config/jogl/gl-impl-CustomJavaCode-gles3.java
(limited to 'make/config/jogl/gl-impl-CustomJavaCode-gles3.java')
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles3.java b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
new file mode 100644
index 000000000..e0b0c6a09
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
@@ -0,0 +1,320 @@
+
+public GLES3Impl(GLProfile glp, GLContextImpl context) {
+ this._context = context;
+ if(null != context) {
+ this.bufferSizeTracker = context.getBufferSizeTracker();
+ this.bufferStateTracker = context.getBufferStateTracker();
+ this.glStateTracker = context.getGLStateTracker();
+ } else {
+ this.bufferSizeTracker = null;
+ this.bufferStateTracker = null;
+ this.glStateTracker = null;
+ }
+ this.glProfile = glp;
+ this._isES3 = glp.getImplName() == GLProfile.GLES3;
+}
+
+@Override
+public final boolean isGL4bc() {
+ return false;
+}
+
+@Override
+public final boolean isGL4() {
+ return false;
+}
+
+@Override
+public final boolean isGL3bc() {
+ return false;
+}
+
+@Override
+public final boolean isGL3() {
+ return false;
+}
+
+public final boolean isGL2() {
+ return false;
+}
+
+@Override
+public final boolean isGLES1() {
+ return false;
+}
+
+@Override
+public final boolean isGLES2() {
+ return true;
+}
+
+@Override
+public final boolean isGLES3() {
+ return _isES3;
+}
+
+@Override
+public final boolean isGLES() {
+ return true;
+}
+
+@Override
+public final boolean isGL2ES1() {
+ return false;
+}
+
+@Override
+public final boolean isGL2ES2() {
+ return true;
+}
+
+@Override
+public final boolean isGL3ES3() {
+ return _isES3;
+}
+
+@Override
+public final boolean isGL4ES3() {
+ return _isES3;
+}
+
+@Override
+public final boolean isGLES2Compatible() {
+ return true;
+}
+
+@Override
+public final boolean isGLES3Compatible() {
+ return _isES3;
+}
+
+
+@Override
+public final boolean isGL2GL3() {
+ return false;
+}
+
+@Override
+public final boolean hasGLSL() {
+ return true;
+}
+
+@Override
+public boolean isNPOTTextureAvailable() {
+ return true;
+}
+
+@Override
+public final GL4bc getGL4bc() throws GLException {
+ throw new GLException("Not a GL4bc implementation");
+}
+
+@Override
+public final GL4 getGL4() throws GLException {
+ throw new GLException("Not a GL4 implementation");
+}
+
+@Override
+public final GL3bc getGL3bc() throws GLException {
+ throw new GLException("Not a GL3bc implementation");
+}
+
+@Override
+public final GL3 getGL3() throws GLException {
+ throw new GLException("Not a GL3 implementation");
+}
+
+@Override
+public final GL2 getGL2() throws GLException {
+ throw new GLException("Not a GL2 implementation");
+}
+
+@Override
+public final GLES1 getGLES1() throws GLException {
+ throw new GLException("Not a GLES1 implementation");
+}
+
+@Override
+public final GLES2 getGLES2() throws GLException {
+ return this;
+}
+
+@Override
+public final GLES3 getGLES3() throws GLException {
+ return this;
+}
+
+@Override
+public final GL2ES1 getGL2ES1() throws GLException {
+ throw new GLException("Not a GL2ES1 implementation");
+}
+
+@Override
+public final GL2ES2 getGL2ES2() throws GLException {
+ return this;
+}
+
+@Override
+public final GL3ES3 getGL3ES3() throws GLException {
+ if(!_isES3) {
+ throw new GLException("Not a GL3ES3 implementation");
+ }
+ return this;
+}
+
+@Override
+public final GL4ES3 getGL4ES3() throws GLException {
+ if(!_isES3) {
+ throw new GLException("Not a GL4ES3 implementation");
+ }
+ return this;
+}
+
+@Override
+public final GL2GL3 getGL2GL3() throws GLException {
+ throw new GLException("Not a GL2GL3 implementation");
+}
+
+//
+// Helpers for ensuring the correct amount of texture data
+//
+
+private final boolean _isES3;
+private final GLBufferSizeTracker bufferSizeTracker;
+private final GLBufferStateTracker bufferStateTracker;
+private final GLStateTracker glStateTracker;
+
+private final boolean checkBufferObject(boolean extensionAvail,
+ boolean allowVAO,
+ boolean enabled,
+ int state,
+ String kind, boolean throwException) {
+ if ( !extensionAvail ) {
+ if ( !enabled ) {
+ return true;
+ }
+ if(throwException) {
+ throw new GLException("Required extensions not available to call this function");
+ }
+ return false;
+ }
+ int buffer = bufferStateTracker.getBoundBufferObject(state, this);
+ if ( enabled ) {
+ if ( 0 != buffer ) {
+ return true;
+ }
+ if ( allowVAO ) {
+ buffer = bufferStateTracker.getBoundBufferObject(GLES3.GL_VERTEX_ARRAY_BINDING, this);
+ if( 0 != buffer && !_context.isDefaultVAO(buffer) ) {
+ return true;
+ }
+ }
+ if ( throwException ) {
+ throw new GLException(kind + " must be enabled to call this method");
+ }
+ return false;
+ } else {
+ if ( 0 == buffer ) {
+ return true;
+ }
+ if ( throwException ) {
+ throw new GLException(kind + " must be disabled to call this method");
+ }
+ return false;
+ }
+}
+
+private final boolean checkArrayVBODisabled(boolean throwException) {
+ return checkBufferObject(true,
+ _isES3, // allowVAO
+ false, // enable
+ GL.GL_ARRAY_BUFFER,
+ "array vertex_buffer_object", throwException);
+}
+
+private final boolean checkArrayVBOEnabled(boolean throwException) {
+ return checkBufferObject(true,
+ _isES3, // allowVAO
+ true, // enable
+ GL.GL_ARRAY_BUFFER,
+ "array vertex_buffer_object", throwException);
+}
+
+private final boolean checkElementVBODisabled(boolean throwException) {
+ return checkBufferObject(true,
+ _isES3, // allowVAO
+ false, // enable
+ GL.GL_ELEMENT_ARRAY_BUFFER,
+ "element vertex_buffer_object", throwException);
+}
+
+private final boolean checkElementVBOEnabled(boolean throwException) {
+ return checkBufferObject(true,
+ _isES3, // allowVAO
+ true, // enable
+ GL.GL_ELEMENT_ARRAY_BUFFER,
+ "element vertex_buffer_object", throwException);
+}
+
+private final boolean checkUnpackPBODisabled(boolean throwException) {
+ return checkBufferObject(_isES3,
+ false, // allowVAO
+ false, // enable
+ GL2.GL_PIXEL_UNPACK_BUFFER,
+ "unpack pixel_buffer_object", throwException);
+}
+
+private final boolean checkUnpackPBOEnabled(boolean throwException) {
+ return checkBufferObject(_isES3,
+ false, // allowVAO
+ true, // enable
+ GL2.GL_PIXEL_UNPACK_BUFFER,
+ "unpack pixel_buffer_object", throwException);
+}
+
+private final boolean checkPackPBODisabled(boolean throwException) {
+ return checkBufferObject(_isES3,
+ false, // allowVAO
+ false, // enable
+ GL2.GL_PIXEL_PACK_BUFFER,
+ "pack pixel_buffer_object", throwException);
+}
+
+private final boolean checkPackPBOEnabled(boolean throwException) {
+ return checkBufferObject(_isES3,
+ false, // allowVAO
+ true, // enable
+ GL2.GL_PIXEL_PACK_BUFFER,
+ "pack pixel_buffer_object", throwException);
+}
+
+@Override
+public final boolean glIsPBOPackEnabled() {
+ return checkPackPBOEnabled(false);
+}
+
+@Override
+public final boolean glIsPBOUnpackEnabled() {
+ return checkUnpackPBOEnabled(false);
+}
+
+/** Entry point to C language function: void * {@native glMapBuffer}(GLenum target, GLenum access);
Part of GL_VERSION_1_5
; GL_OES_mapbuffer
*/
+public final java.nio.ByteBuffer glMapBuffer(int target, int access) {
+ return glMapBufferImpl(target, false, 0, 0, access, ((GLES3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer);
+}
+
+/** Entry point to C language function: void * {@native glMapBufferRange}(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
Part of GL_ES_VERSION_3_0
, GL_VERSION_3_0
; GL_EXT_map_buffer_range
*/
+public final ByteBuffer glMapBufferRange(int target, long offset, long length, int access) {
+ return glMapBufferImpl(target, true, offset, length, access, ((GLES3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBufferRange);
+}
+
+@Override
+public final void glClearDepth(double depth) {
+ glClearDepthf((float)depth);
+}
+
+@Override
+public final void glDepthRange(double zNear, double zFar) {
+ glDepthRangef((float)zNear, (float)zFar);
+}
+
--
cgit v1.2.3
From 6136457f10d020c779adc78641d0048f77ab1635 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Mon, 15 Jul 2013 22:49:47 +0200
Subject: Fix BuildComposablePipeline's isGL*/getGL* ; GLBase:
getDownstreamGL()/getRootGL(); GLContext.isGL* added proper API doc.,
isGL3core()/hasNoDefaultVAO() and getDefaultVAO().
- Fix BuildComposablePipeline's isGL*/getGL* (regression of commit 3a0d7703da32e9a5ddf08a334f18588a78038d880)
- GLBase: getDownstreamGL()/getRootGL()
Allows user traversing through pipelined GL instances.
Also added getRootGL() to GLContext.
- GLContext.isGL* added proper API doc.: We test the actual context, not the profile.
- GLContext isGL3core()/hasNoDefaultVAO() and getDefaultVAO()
- Move isGL3code() def. back to pre 3a0d7703da32e9a5ddf08a334f18588a78038d880, i.e. Includes [ GL4, GL3 ] w/o GLES3.
- Added hasNoDefaultVAO() and getDefaultVAO() .. incl. [ GL4, GL3, GLES3 ]
---
.../config/jogl/gl-impl-CustomJavaCode-common.java | 10 ++
make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java | 2 +-
make/config/jogl/gl-impl-CustomJavaCode-gles3.java | 2 +-
.../gluegen/opengl/BuildComposablePipeline.java | 49 ++++++---
src/jogl/classes/javax/media/opengl/GLBase.java | 71 +++++++++---
src/jogl/classes/javax/media/opengl/GLContext.java | 121 ++++++++++++++++++---
src/jogl/classes/jogamp/opengl/GLContextImpl.java | 33 +++---
7 files changed, 228 insertions(+), 60 deletions(-)
(limited to 'make/config/jogl/gl-impl-CustomJavaCode-gles3.java')
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-common.java b/make/config/jogl/gl-impl-CustomJavaCode-common.java
index 4024d8e1a..2254e5f0b 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-common.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-common.java
@@ -24,6 +24,16 @@
return checkElementVBOEnabled(false);
}
+ @Override
+ public final GL getDownstreamGL() throws GLException {
+ return null;
+ }
+
+ @Override
+ public final GL getRootGL() throws GLException {
+ return this;
+ }
+
@Override
public final boolean isGL() {
return true;
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
index cacea322a..5ac2837fa 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
@@ -287,7 +287,7 @@ private final boolean checkBufferObject(boolean extensionAvail,
}
if ( allowVAO ) {
buffer = bufferStateTracker.getBoundBufferObject(GL2GL3.GL_VERTEX_ARRAY_BINDING, this);
- if( 0 != buffer && !_context.isDefaultVAO(buffer) ) {
+ if( 0 != buffer && _context.getDefaultVAO() != buffer ) {
return true;
}
}
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles3.java b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
index e0b0c6a09..bb4a6246b 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
@@ -205,7 +205,7 @@ private final boolean checkBufferObject(boolean extensionAvail,
}
if ( allowVAO ) {
buffer = bufferStateTracker.getBoundBufferObject(GLES3.GL_VERTEX_ARRAY_BINDING, this);
- if( 0 != buffer && !_context.isDefaultVAO(buffer) ) {
+ if( 0 != buffer && _context.getDefaultVAO() != buffer ) {
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 b9096df3c..0bd3086c8 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
@@ -167,16 +167,16 @@ public class BuildComposablePipeline {
*/
public void emit() throws IOException {
- List publicMethodsRaw = Arrays.asList(classToComposeAround.getMethods());
+ final List publicMethodsRaw = Arrays.asList(classToComposeAround.getMethods());
- Set publicMethodsPlain = new HashSet();
+ final Set publicMethodsPlain = new HashSet();
for (Iterator iter = publicMethodsRaw.iterator(); iter.hasNext();) {
- Method method = iter.next();
+ final Method method = iter.next();
// Don't hook methods which aren't real GL methods,
// such as the synthetic "isGL2ES2" "getGL2ES2"
- String name = method.getName();
+ final String name = method.getName();
boolean runHooks = name.startsWith("gl");
- if (!name.startsWith("getGL") && !name.startsWith("isGL") && !name.equals("toString")) {
+ if ( !name.startsWith("getGL") && !name.startsWith("isGL") && !name.equals("getDownstreamGL") && !name.equals("toString") ) {
publicMethodsPlain.add(new PlainMethod(method, runHooks));
}
}
@@ -603,8 +603,13 @@ public class BuildComposablePipeline {
*/
protected void emitGLIsMethod(PrintWriter output, String type) {
output.println(" @Override");
- output.println(" public boolean is" + type + "() {");
- output.println(" return " + getDownstreamObjectName() + ".is" + type + "();");
+ output.println(" public final boolean is" + type + "() {");
+ final Class> clazz = BuildComposablePipeline.getClass("javax.media.opengl." + type);
+ if (clazz.isAssignableFrom(baseInterfaceClass)) {
+ output.println(" return true;");
+ } else {
+ output.println(" return false;");
+ }
output.println(" }");
}
@@ -626,9 +631,18 @@ public class BuildComposablePipeline {
emitGLIsMethod(output, "GL3ES3");
emitGLIsMethod(output, "GL4ES3");
emitGLIsMethod(output, "GL2GL3");
- emitGLIsMethod(output, "GLES");
- emitGLIsMethod(output, "GLES2Compatible");
- emitGLIsMethod(output, "GLES3Compatible");
+ output.println(" @Override");
+ output.println(" public final boolean isGLES() {");
+ output.println(" return isGLES2() || isGLES1();");
+ output.println(" }");
+ output.println(" @Override");
+ output.println(" public final boolean isGLES2Compatible() {");
+ output.println(" return " + getDownstreamObjectName() + ".isGLES2Compatible();");
+ output.println(" }");
+ output.println(" @Override");
+ output.println(" public final boolean isGLES3Compatible() {");
+ output.println(" return " + getDownstreamObjectName() + ".isGLES3Compatible();");
+ output.println(" }");
}
/**
@@ -636,8 +650,13 @@ public class BuildComposablePipeline {
*/
protected void emitGLGetMethod(PrintWriter output, String type) {
output.println(" @Override");
- output.println(" public javax.media.opengl." + type + " get" + type + "() {");
- output.println(" return " + getDownstreamObjectName() + ".get" + type + "();");
+ output.println(" public final javax.media.opengl." + type + " get" + type + "() {");
+ final Class> clazz = BuildComposablePipeline.getClass("javax.media.opengl." + type);
+ if (clazz.isAssignableFrom(baseInterfaceClass)) {
+ output.println(" return this;");
+ } else {
+ output.println(" throw new GLException(\"Not a " + type + " implementation\");");
+ }
output.println(" }");
}
@@ -660,7 +679,11 @@ public class BuildComposablePipeline {
emitGLGetMethod(output, "GL4ES3");
emitGLGetMethod(output, "GL2GL3");
output.println(" @Override");
- output.println(" public GLProfile getGLProfile() {");
+ output.println(" public final GL getDownstreamGL() throws GLException {");
+ output.println(" return " + getDownstreamObjectName() + ";");
+ output.println(" }");
+ output.println(" @Override");
+ output.println(" public final GLProfile getGLProfile() {");
output.println(" return " + getDownstreamObjectName() + ".getGLProfile();");
output.println(" }");
}
diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java
index 49c5bf72d..fcfe34132 100644
--- a/src/jogl/classes/javax/media/opengl/GLBase.java
+++ b/src/jogl/classes/javax/media/opengl/GLBase.java
@@ -88,35 +88,41 @@ public interface GLBase {
/**
* Indicates whether this GL object conforms to the OpenGL ≥ 4.0 compatibility profile.
* The GL4 compatibility profile includes the GL2, GL2ES1, GL2ES2, GL3, GL3bc and GL4 profile.
+ * @see GLContext#isGL4bc()
*/
public boolean isGL4bc();
/**
* Indicates whether this GL object conforms to the OpenGL ≥ 4.0 core profile.
* The GL4 core profile includes the GL2ES2, and GL3 profile.
+ * @see GLContext#isGL4()
*/
public boolean isGL4();
/**
* Indicates whether this GL object conforms to the OpenGL ≥ 3.1 compatibility profile.
* The GL3 compatibility profile includes the GL2, GL2ES1, GL2ES2 and GL3 profile.
+ * @see GLContext#isGL3bc()
*/
public boolean isGL3bc();
/**
* Indicates whether this GL object conforms to the OpenGL ≥ 3.1 core profile.
* The GL3 core profile includes the GL2ES2 profile.
+ * @see GLContext#isGL3()
*/
public boolean isGL3();
/**
* Indicates whether this GL object conforms to the OpenGL ≤ 3.0 profile.
* The GL2 profile includes the GL2ES1 and GL2ES2 profile.
+ * @see GLContext#isGL2()
*/
public boolean isGL2();
/**
* Indicates whether this GL object conforms to the OpenGL ES1 ≥ 1.0 profile.
+ * @see GLContext#isGLES1()
*/
public boolean isGLES1();
@@ -127,6 +133,7 @@ public interface GLBase {
* To query whether core ES2 functionality is provided, use {@link #isGLES2Compatible()}.
*
* @see #isGLES2Compatible()
+ * @see GLContext#isGLES2()
*/
public boolean isGLES2();
@@ -137,44 +144,52 @@ public interface GLBase {
* To query whether core ES3 functionality is provided, use {@link #isGLES3Compatible()}.
*
* @see #isGLES3Compatible()
+ * @see GLContext#isGLES3()
*/
public boolean isGLES3();
/**
* Indicates whether this GL object conforms to one of the OpenGL ES profiles,
* see {@link #isGLES1()} and {@link #isGLES2()}.
+ * @see GLContext#isGLES()
*/
public boolean isGLES();
/**
* Indicates whether this GL object conforms to a GL2ES1 compatible profile.
+ * @see GLContext#isGL2ES1()
*/
public boolean isGL2ES1();
/**
* Indicates whether this GL object conforms to a GL2ES2 compatible profile.
+ * @see GLContext#isGL2ES2()
*/
public boolean isGL2ES2();
/**
* Indicates whether this GL object conforms to a GL3ES3 compatible profile.
+ * @see GLContext#isGL3ES3()
*/
public boolean isGL3ES3();
/**
* Indicates whether this GL object conforms to a GL4ES3 compatible profile.
+ * @see GLContext#isGL4ES3()
*/
public boolean isGL4ES3();
/**
* Indicates whether this GL object conforms to a GL2GL3 compatible profile.
+ * @see GLContext#isGL2GL3()
*/
public boolean isGL2GL3();
/**
* Indicates whether this GL object is compatible with the core OpenGL ES2 functionality.
* @return true if this context is an ES2 context or implements
- * the extension GL_ARB_ES2_compatibility
, otherwise false
+ * the extension GL_ARB_ES2_compatibility
, otherwise false
+ * @see GLContext#isGLES2Compatible()
*/
public boolean isGLES2Compatible();
@@ -182,93 +197,117 @@ public interface GLBase {
* Indicates whether this GL object is compatible with the core OpenGL ES3 functionality.
* @return true if this context is an ES3 context or implements
* the extension GL_ARB_ES3_compatibility
, otherwise false
+ * @see GLContext#isGLES3Compatible()
*/
public boolean isGLES3Compatible();
- /** Indicates whether this GL object supports GLSL. */
+ /**
+ * Indicates whether this GL object supports GLSL.
+ * @see GLContext#hasGLSL()
+ */
public boolean hasGLSL();
+ /**
+ * Returns the downstream GL instance in case this is a wrapping pipeline, otherwise null
.
+ *
+ * See {@link #getRootGL()} for retrieving the implementing root instance.
+ *
+ * @throws GLException if the downstream instance is not null and not a GL implementation
+ * @see #getRootGL()
+ */
+ public GL getDownstreamGL() throws GLException;
+
+ /**
+ * Returns the implementing root instance, considering a wrapped pipelined hierarchy, see {@link #getDownstreamGL()}.
+ *
+ * If this instance is not a wrapping pipeline, i.e. has no downstream instance,
+ * this instance is returned.
+ *
+ * @throws GLException if the root instance is not a GL implementation
+ */
+ public GL getRootGL() throws GLException;
+
/**
* Casts this object to the GL interface.
- * @throws GLException if this GLObject is not a GL implementation
+ * @throws GLException if this object is not a GL implementation
*/
public GL getGL() throws GLException;
/**
* Casts this object to the GL4bc interface.
- * @throws GLException if this GLObject is not a GL4bc implementation
+ * @throws GLException if this object is not a GL4bc implementation
*/
public GL4bc getGL4bc() throws GLException;
/**
* Casts this object to the GL4 interface.
- * @throws GLException if this GLObject is not a GL4 implementation
+ * @throws GLException if this object is not a GL4 implementation
*/
public GL4 getGL4() throws GLException;
/**
* Casts this object to the GL3bc interface.
- * @throws GLException if this GLObject is not a GL3bc implementation
+ * @throws GLException if this object is not a GL3bc implementation
*/
public GL3bc getGL3bc() throws GLException;
/**
* Casts this object to the GL3 interface.
- * @throws GLException if this GLObject is not a GL3 implementation
+ * @throws GLException if this object is not a GL3 implementation
*/
public GL3 getGL3() throws GLException;
/**
* Casts this object to the GL2 interface.
- * @throws GLException if this GLObject is not a GL2 implementation
+ * @throws GLException if this object is not a GL2 implementation
*/
public GL2 getGL2() throws GLException;
/**
* Casts this object to the GLES1 interface.
- * @throws GLException if this GLObject is not a GLES1 implementation
+ * @throws GLException if this object is not a GLES1 implementation
*/
public GLES1 getGLES1() throws GLException;
/**
* Casts this object to the GLES2 interface.
- * @throws GLException if this GLObject is not a GLES2 implementation
+ * @throws GLException if this object is not a GLES2 implementation
*/
public GLES2 getGLES2() throws GLException;
/**
* Casts this object to the GLES3 interface.
- * @throws GLException if this GLObject is not a GLES3 implementation
+ * @throws GLException if this object is not a GLES3 implementation
*/
public GLES3 getGLES3() throws GLException;
/**
* Casts this object to the GL2ES1 interface.
- * @throws GLException if this GLObject is not a GL2ES1 implementation
+ * @throws GLException if this object is not a GL2ES1 implementation
*/
public GL2ES1 getGL2ES1() throws GLException;
/**
* Casts this object to the GL2ES2 interface.
- * @throws GLException if this GLObject is not a GL2ES2 implementation
+ * @throws GLException if this object is not a GL2ES2 implementation
*/
public GL2ES2 getGL2ES2() throws GLException;
/**
* Casts this object to the GL3ES3 interface.
- * @throws GLException if this GLObject is not a GL3ES3 implementation
+ * @throws GLException if this object is not a GL3ES3 implementation
*/
public GL3ES3 getGL3ES3() throws GLException;
/**
* Casts this object to the GL4ES3 interface.
- * @throws GLException if this GLObject is not a GL3ES3 implementation
+ * @throws GLException if this object is not a GL3ES3 implementation
*/
public GL4ES3 getGL4ES3() throws GLException;
/**
* Casts this object to the GL2GL3 interface.
- * @throws GLException if this GLObject is not a GL2GL3 implementation
+ * @throws GLException if this object is not a GL2GL3 implementation
*/
public GL2GL3 getGL2GL3() throws GLException;
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index b27db18af..9d383c371 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -503,6 +503,17 @@ public abstract class GLContext {
*/
public abstract void destroy();
+ /**
+ * Returns the implementing root GL instance of this GLContext's GL object,
+ * considering a wrapped pipelined hierarchy, see {@link GLBase#getDownstreamGL()}.
+ * @throws GLException if the root instance is not a GL implementation
+ * @see GLBase#getRootGL()
+ * @see GLBase#getDownstreamGL()
+ * @see #getGL()
+ * @see #setGL(GL)
+ */
+ public abstract GL getRootGL();
+
/**
* Returns the GL pipeline object for this GLContext.
*
@@ -915,40 +926,83 @@ public abstract class GLContext {
isExtensionAvailable(GLExtensions.IMG_texture_format_BGRA8888) ;
}
- /** @see GLProfile#isGL4bc() */
+ /**
+ * Indicates whether this GLContext is capable of GL4bc. Includes [ GL4bc ].
+ * @see GLProfile#isGL4bc()
+ */
public final boolean isGL4bc() {
return ctxVersion.getMajor() >= 4 && 0 != (ctxOptions & CTX_IS_ARB_CREATED)
&& 0 != (ctxOptions & CTX_PROFILE_COMPAT);
}
- /** @see GLProfile#isGL4() */
+ /**
+ * Indicates whether this GLContext is capable of GL4. Includes [ GL4bc, GL4 ].
+ * @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));
}
- /** Indicates whether this profile is capable of GL4 (core only). Includes [ GL4 ].
*/
+ /**
+ * Indicates whether this GLContext is capable of GL4 (core only). Includes [ GL4 ].
+ */
public final boolean isGL4core() {
return ctxVersion.getMajor() >= 4 && 0 != (ctxOptions & CTX_IS_ARB_CREATED)
&& 0 != (ctxOptions & CTX_PROFILE_CORE);
}
- /** @see GLProfile#isGL3bc() */
+ /**
+ * Indicates whether this GLContext is capable of GL3bc. Includes [ GL4bc, GL3bc ].
+ * @see GLProfile#isGL3bc()
+ */
public final boolean isGL3bc() {
return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
0 != (ctxOptions & CTX_PROFILE_COMPAT) &&
ctxVersion.compareTo(Version310) >= 0 ;
}
- /** @see GLProfile#isGL3() */
+ /**
+ * Indicates whether this GLContext is capable of GL3. Includes [ GL4bc, GL4, GL3bc, GL3 ].
+ * @see GLProfile#isGL3()
+ */
public final boolean isGL3() {
return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
0 != (ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_CORE)) &&
ctxVersion.compareTo(Version310) >= 0 ;
}
- /** Indicates whether this profile is capable of GL3 (core only). GL3 starts w/ OpenGL 3.1 Includes [ GL4, GL3, GLES3 ].
*/
+ /**
+ * Indicates whether this GLContext is capable of GL3 (core only). GL3 starts w/ OpenGL 3.1 Includes [ GL4, GL3 ].
+ */
public final boolean isGL3core() {
+ return 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 vertex array object (VAO),
+ * starting w/ OpenGL 3.1 core and GLES3.
+ * Includes [ GL4, GL3, GLES3 ].
+ *
+ Due to GL 3.1 core spec: E.1. DEPRECATED AND REMOVED FEATURES (p 296),
+ GL 3.2 core spec: E.2. DEPRECATED AND REMOVED FEATURES (p 331)
+ there is no more default VAO buffer 0 bound, hence generating and binding one
+ to avoid INVALID_OPERATION at VertexAttribPointer.
+ More clear is GL 4.3 core spec: 10.4 (p 307).
+ *
+ *
+ GLES3 is included, since upcoming ES releases > 3.0 may behave the same:
+ GL ES 3.0 spec F.1. Legacy Features (p 322).
+ *
+ *
+ * If no default VAO is implemented in the native OpenGL profile,
+ * an own default VAO is being used, see {@link #getDefaultVAO()}.
+ *
+ * @see #getDefaultVAO()
+ */
+ public final boolean hasNoDefaultVAO() {
return ( 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 3 ) ||
( 0 != ( ctxOptions & CTX_IS_ARB_CREATED ) &&
0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
@@ -956,52 +1010,87 @@ public abstract class GLContext {
) ;
}
- /** @see GLProfile#isGL2() */
+ /**
+ * If this GLContext does not implement a default VAO, see {@link #hasNoDefaultVAO()},
+ * an own default VAO will be created and bound at context creation.
+ *
+ * If this GLContext does implement a default VAO, i.e. {@link #hasNoDefaultVAO()}
+ * returns false
, this method returns 0
.
+ *
+ *
+ * Otherwise this method returns the VAO object name
+ * representing this GLContext's own default VAO.
+ *
+ * @see #hasNoDefaultVAO()
+ */
+ public abstract int getDefaultVAO();
+
+ /**
+ * @see GLProfile#isGL2()
+ */
public final boolean isGL2() {
return 0 != ( ctxOptions & CTX_PROFILE_COMPAT ) && ctxVersion.getMajor()>=1 ;
}
- /** @see GLProfile#isGL2GL3() */
+ /**
+ * @see GLProfile#isGL2GL3()
+ */
public final boolean isGL2GL3() {
return isGL2() || isGL3();
}
- /** @see GLProfile#isGLES1() */
+ /**
+ * @see GLProfile#isGLES1()
+ */
public final boolean isGLES1() {
return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() == 1 ;
}
- /** @see GLProfile#isGLES2() */
+ /**
+ * @see GLProfile#isGLES2()
+ */
public final boolean isGLES2() {
return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 2 ;
}
- /** @see GLProfile#isGLES3() */
+ /**
+ * @see GLProfile#isGLES3()
+ */
public final boolean isGLES3() {
return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 3 ;
}
- /** @see GLProfile#isGLES() */
+ /**
+ * @see GLProfile#isGLES()
+ */
public final boolean isGLES() {
return 0 != ( CTX_PROFILE_ES & ctxOptions ) ;
}
- /** @see GLProfile#isGL2ES1() */
+ /**
+ * @see GLProfile#isGL2ES1()
+ */
public final boolean isGL2ES1() {
return isGLES1() || isGL2();
}
- /** @see GLProfile#isGL2ES2() */
+ /**
+ * @see GLProfile#isGL2ES2()
+ */
public final boolean isGL2ES2() {
return isGLES2() || isGL2GL3();
}
- /** @see GLProfile#isGL3ES3() */
+ /**
+ * @see GLProfile#isGL3ES3()
+ */
public final boolean isGL3ES3() {
return isGL4ES3() || isGL3();
}
- /** @see GLProfile#isGL4ES3() */
+ /**
+ * @see GLProfile#isGL4ES3()
+ */
public final boolean isGL4ES3() {
return isGL4() || isGLES3() ;
}
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 18e136815..5da60597e 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -67,8 +67,8 @@ import javax.media.nativewindow.NativeSurface;
import javax.media.nativewindow.NativeWindowFactory;
import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
-import javax.media.opengl.GL2ES3;
import javax.media.opengl.GL2GL3;
+import javax.media.opengl.GL3ES3;
import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLContext;
import javax.media.opengl.GLDebugListener;
@@ -262,6 +262,17 @@ public abstract class GLContextImpl extends GLContext {
return (GLDrawableImpl) getGLDrawable();
}
+ @Override
+ public final GL getRootGL() {
+ GL _gl = gl;
+ GL _parent = _gl.getDownstreamGL();
+ while ( null != _parent ) {
+ _gl = _parent;
+ _parent = _gl.getDownstreamGL();
+ }
+ return _gl;
+ }
+
@Override
public final GL getGL() {
return gl;
@@ -279,6 +290,11 @@ public abstract class GLContextImpl extends GLContext {
return gl;
}
+ @Override
+ public final int getDefaultVAO() {
+ return defaultVAO;
+ }
+
/**
* Call this method to notify the OpenGL context
* that the drawable has changed (size or position).
@@ -399,7 +415,7 @@ public abstract class GLContextImpl extends GLContext {
}
if ( 0 != defaultVAO ) {
final int[] tmp = new int[] { defaultVAO };
- final GL2ES3 gl3es3 = gl.getGL3ES3();
+ final GL3ES3 gl3es3 = gl.getRootGL().getGL3ES3();
gl3es3.glBindVertexArray(0);
gl3es3.glDeleteVertexArrays(1, tmp, 0);
defaultVAO = 0;
@@ -636,14 +652,9 @@ public abstract class GLContextImpl extends GLContext {
final boolean created;
try {
created = createImpl(shareWith); // may throws exception if fails!
- if( created && isGL3core() ) {
- // Due to GL 3.1 core spec: E.1. DEPRECATED AND REMOVED FEATURES (p 296),
- // GL 3.2 core spec: E.2. DEPRECATED AND REMOVED FEATURES (p 331)
- // there is no more default VAO buffer 0 bound, hence generating and binding one
- // to avoid INVALID_OPERATION at VertexAttribPointer.
- // More clear is GL 4.3 core spec: 10.4 (p 307).
+ if( created && hasNoDefaultVAO() ) {
final int[] tmp = new int[1];
- final GL2ES3 gl3es3 = gl.getGL3ES3();
+ final GL3ES3 gl3es3 = gl.getRootGL().getGL3ES3();
gl3es3.glGenVertexArrays(1, tmp, 0);
defaultVAO = tmp[0];
gl3es3.glBindVertexArray(defaultVAO);
@@ -1955,10 +1966,6 @@ public abstract class GLContextImpl extends GLContext {
return glStateTracker;
}
- public final boolean isDefaultVAO(int vao) {
- return defaultVAO == vao;
- }
-
//---------------------------------------------------------------------------
// Helpers for context optimization where the last context is left
// current on the OpenGL worker thread
--
cgit v1.2.3
From 5dafc958385da595160dc0d3c843c8253334c3c5 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Tue, 16 Jul 2013 05:34:49 +0200
Subject: GL*: Expose isGL*Core(); GLContext: isGL*() API doc cleanup - align
queries.
---
make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java | 15 ++++++++
make/config/jogl/gl-impl-CustomJavaCode-gles1.java | 15 ++++++++
make/config/jogl/gl-impl-CustomJavaCode-gles3.java | 15 ++++++++
.../gluegen/opengl/BuildComposablePipeline.java | 12 ++++++
src/jogl/classes/javax/media/opengl/GLBase.java | 18 +++++++++
src/jogl/classes/javax/media/opengl/GLContext.java | 44 +++++++++++++++++-----
6 files changed, 109 insertions(+), 10 deletions(-)
(limited to 'make/config/jogl/gl-impl-CustomJavaCode-gles3.java')
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
@@ -99,6 +99,21 @@ public final boolean isGL4ES3() {
return _context.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
@@ -77,6 +77,21 @@ public final boolean isGL4ES3() {
return false;
}
+@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
@@ -78,6 +78,21 @@ public final boolean isGL4ES3() {
return _isES3;
}
+@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. Includes [ GL4 ].
+ * @see GLContext#isGL4core()
+ */
+ public boolean isGL4core();
+
+ /**
+ * Indicates whether this GL object uses a GL3 core profile. Includes [ GL4, GL3 ].
+ * @see GLContext#isGL3core()
+ */
+ public boolean isGL3core();
+
+ /**
+ * Indicates whether this GL object uses a GL core profile. Includes [ GL4, GL3, GLES3, GL2ES2 ].
+ * @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). Includes [ GL4 ].
+ * Indicates whether this GLContext uses a GL4 core profile. Includes [ GL4 ].
*/
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 Includes [ GL4, GL3 ].
+ * Indicates whether this GLContext uses a GL3 core profile. Includes [ GL4, GL3 ].
*/
public final boolean isGL3core() {
return 0 != ( ctxOptions & CTX_IS_ARB_CREATED ) &&
@@ -984,6 +987,17 @@ public abstract class GLContext {
ctxVersion.compareTo(Version310) >= 0;
}
+ /**
+ * Indicates whether this GLContext uses a GL core profile. Includes [ GL4, GL3, GLES3, GL2ES2 ].
+ */
+ 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 vertex array object (VAO),
* starting w/ OpenGL 3.1 core and GLES3.
@@ -1029,6 +1043,7 @@ public abstract class GLContext {
public abstract int getDefaultVAO();
/**
+ * Indicates whether this GLContext is capable of GL2. Includes [ GL4bc, GL3bc, GL2 ].
* @see GLProfile#isGL2()
*/
public final boolean isGL2() {
@@ -1036,6 +1051,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GL2GL3. Includes [ GL4bc, GL4, GL3bc, GL3, GL2, GL2GL3 ].
* @see GLProfile#isGL2GL3()
*/
public final boolean isGL2GL3() {
@@ -1043,13 +1059,15 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GLES1. Includes [ GLES1 ].
* @see GLProfile#isGLES1()
*/
public final boolean isGLES1() {
return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() == 1 ;
}
- /**
+ /**
+ * Indicates whether this GLContext is capable of GLES2. Includes [ GLES3, GLES2 ].
* @see GLProfile#isGLES2()
*/
public final boolean isGLES2() {
@@ -1057,6 +1075,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GLES3. Includes [ GLES3 ].
* @see GLProfile#isGLES3()
*/
public final boolean isGLES3() {
@@ -1064,6 +1083,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GLES. Includes [ GLES3, GLES1, GLES2 ].
* @see GLProfile#isGLES()
*/
public final boolean isGLES() {
@@ -1071,6 +1091,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GL2ES1. Includes [ GL4bc, GL3bc, GL2, GLES1, GL2ES1 ].
* @see GLProfile#isGL2ES1()
*/
public final boolean isGL2ES1() {
@@ -1078,6 +1099,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GL2ES2. Includes [ GL4bc, GL4, GL3bc, GL3, GLES3, GL2, GL2GL3, GL2ES2, GLES2 ].
* @see GLProfile#isGL2ES2()
*/
public final boolean isGL2ES2() {
@@ -1085,6 +1107,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this GLContext is capable of GL3ES3. Includes [ GL4bc, GL4, GL3bc, GL3, GLES3 ].
* @see GLProfile#isGL3ES3()
*/
public final boolean isGL3ES3() {
@@ -1092,6 +1115,7 @@ public abstract class GLContext {
}
/**
+ * Indicates whether this profile is capable of GL4ES3. Includes [ GL4bc, GL4, GLES3 ].
* @see GLProfile#isGL4ES3()
*/
public final boolean isGL4ES3() {
--
cgit v1.2.3