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. --- .../opengl/util/glsl/fixedfunc/FixedFuncPipeline.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc') diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java index 2e924cbfb..173f7b3c6 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java @@ -40,6 +40,7 @@ import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2ES2; import javax.media.opengl.GL2GL3; import javax.media.opengl.GLArrayData; +import javax.media.opengl.GLES2; import javax.media.opengl.GLException; import javax.media.opengl.GLRunnable2; import javax.media.opengl.GLUniformData; @@ -741,11 +742,17 @@ public class FixedFuncPipeline { gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0xffffffff & b.get(idx0+j)), 4); } } - } else if( GL2ES1.GL_POINTS != mode ) { - gl.glDrawElements(mode, count, type, indices); } else { - // FIXME GL_POINTS ! - gl.glDrawElements(mode, count, type, indices); + // FIXME: Impl. VBO usage .. or unroll (see above)! + if( !gl.getContext().isCPUSourcedAvail() ) { + throw new GLException("CPU sourcing n/a w/ "+gl.getContext()); + } + if( GL2ES1.GL_POINTS != mode ) { + ((GLES2)gl).glDrawElements(mode, count, type, indices); + } else { + // FIXME GL_POINTS ! + ((GLES2)gl).glDrawElements(mode, count, type, indices); + } } } public void glDrawElements(GL2ES2 gl, int mode, int count, int type, long indices_buffer_offset) { -- cgit v1.2.3