From 4e83a5df7a851cc33d85f76381f058256906ad4c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 10 Oct 2013 02:15:56 +0200 Subject: Bug 852: Remove CPU sourced data API entry where not allowed (ES3 and GL core >= 3.0) ; GL2 cfg: Ignore GL2ES3 symbols (super) Remove CPU sourced data API entries via new config 'BufferObjectOnly ', listed in 'gl-common-gpubufferonly.cfg' and included in ES3 and all GL core >= 3 interfaces. If BufferObjectOnly is defined for a function, only the 'long offset' variant is being emitted. Due to limitations of GlueGen's 'ExtendedInterfaceSymbolsIgnore A.java', which only identifies the function name and not the signature - all CPU sourced variants are manually added to the compatibility and ES2 GL profiles via '*-common-cpubufferJavaCode.java' files. GLContext: Added 'isCPUSourcedAvail()' to determine whether context allows CPU sourced data, i.e. for GL2ES1 and GLES2 ctx. GLContext/GLProfile/GL: isGLES2() now returns false if having a ES3 context due to 'CPU sourced' incompatibility! +++ GL2 cfg: Added ignore GL2ES3 symbols of it's superclass, removing duplicated symbols. --- src/jogl/classes/javax/media/opengl/GLContext.java | 14 ++++++++++++-- src/jogl/classes/javax/media/opengl/GLProfile.java | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/javax') diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java index 2dca2a685..3a72319bb 100644 --- a/src/jogl/classes/javax/media/opengl/GLContext.java +++ b/src/jogl/classes/javax/media/opengl/GLContext.java @@ -1009,6 +1009,16 @@ public abstract class GLContext { ) ; } + /** + * Indicates whether this GLContext allows CPU sourced data (indices, vertices ..) as opposed to a GPU buffer source (VBO), + * e.g. {@link GL2#glDrawElements(int, int, int, java.nio.Buffer)}. + *

Includes [GL2ES1, GLES2] == [ GL4bc, GL3bc, GL2, GLES1, GL2ES1, GLES2 ].

+ *

See Bug 852 - https://jogamp.org/bugzilla/show_bug.cgi?id=852

+ */ + public final boolean isCPUSourcedAvail() { + return isGL2ES1() || isGLES2(); + } + /** * Indicates whether this GLContext's native profile does not implement a default vertex array object (VAO), * starting w/ OpenGL 3.1 core and GLES3. @@ -1078,11 +1088,11 @@ public abstract class GLContext { } /** - * Indicates whether this GLContext is capable of GLES2.

Includes [ GLES3, GLES2 ].

+ * Indicates whether this GLContext is capable of GLES2.

Includes [ GLES2 ].

* @see GLProfile#isGLES2() */ public final boolean isGLES2() { - return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 2 ; + return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() == 2 ; } /** diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 1dde2cbb6..4a2edc56b 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -1098,9 +1098,9 @@ public class GLProfile { return GLES1 == profile; } - /** Indicates whether this profile is capable of GLES2.

Includes [ GLES3, GLES2 ].

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

Includes [ GLES2 ].

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

Includes [ GLES3 ].

*/ -- cgit v1.2.3