diff options
Diffstat (limited to 'make/config')
-rwxr-xr-x | make/config/jogl/gl-if-gl2_es2.cfg | 19 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java | 260 | ||||
-rwxr-xr-x | make/config/jogl/gl-impl-CustomJavaCode-gles1.java | 4 |
3 files changed, 0 insertions, 283 deletions
diff --git a/make/config/jogl/gl-if-gl2_es2.cfg b/make/config/jogl/gl-if-gl2_es2.cfg index 832c32ee5..5345c3ba1 100755 --- a/make/config/jogl/gl-if-gl2_es2.cfg +++ b/make/config/jogl/gl-if-gl2_es2.cfg @@ -39,25 +39,6 @@ GLHeader GL/glext.h # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true -CustomJavaCode GL2ES2 public String glGetShaderInfoLog(int shaderObj); -CustomJavaCode GL2ES2 public String glGetProgramInfoLog(int programObj); -CustomJavaCode GL2ES2 public boolean glIsShaderStatusValid(int shaderObj, int name); -CustomJavaCode GL2ES2 public boolean glIsShaderStatusValid(int shaderObj, int name, PrintStream verboseOut); -CustomJavaCode GL2ES2 public boolean glIsShaderStatusValid(IntBuffer shaders, int name); -CustomJavaCode GL2ES2 public boolean glIsShaderStatusValid(IntBuffer shaders, int name, PrintStream verboseOut); -CustomJavaCode GL2ES2 public boolean glIsProgramStatusValid(int programObj, int name); -CustomJavaCode GL2ES2 public boolean glIsProgramValid(int programObj); -CustomJavaCode GL2ES2 public boolean glIsProgramValid(int programObj, PrintStream verboseOut); -CustomJavaCode GL2ES2 public boolean glShaderCompilerAvailable(); -CustomJavaCode GL2ES2 public void glShaderSource(int shader, java.lang.String[] source); -CustomJavaCode GL2ES2 public void glShaderSource(IntBuffer shaders, java.lang.String[][] sources); -CustomJavaCode GL2ES2 public Set glGetShaderBinaryFormats(); -CustomJavaCode GL2ES2 public void glShaderBinary(IntBuffer shaders, int binFormat, java.nio.Buffer bin); -CustomJavaCode GL2ES2 public void glCreateShader(int type, IntBuffer shaders); -CustomJavaCode GL2ES2 public void glCompileShader(IntBuffer shaders); -CustomJavaCode GL2ES2 public void glAttachShader(int program, IntBuffer shaders); -CustomJavaCode GL2ES2 public void glDetachShader(int program, IntBuffer shaders); -CustomJavaCode GL2ES2 public void glDeleteShader(IntBuffer shaders); CustomJavaCode GL2ES2 public void glVertexAttribPointer(GLArrayData array); CustomJavaCode GL2ES2 public void glUniform(GLUniformData data); CustomJavaCode GL2ES2 diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java index 2f3710eb2..0d0daf463 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java @@ -1,242 +1,3 @@ - public String glGetShaderInfoLog(int shaderObj) { - int[] infoLogLength=new int[1]; - glGetShaderiv(shaderObj, GL_INFO_LOG_LENGTH, infoLogLength, 0); - - if(infoLogLength[0]==0) { - return "(InfoLog null)"; - } - int[] charsWritten=new int[1]; - byte[] infoLogBytes = new byte[infoLogLength[0]]; - glGetShaderInfoLog(shaderObj, infoLogLength[0], charsWritten, 0, infoLogBytes, 0); - - return new String(infoLogBytes, 0, charsWritten[0]); - } - - public String glGetProgramInfoLog(int programObj) { - int[] infoLogLength=new int[1]; - glGetProgramiv(programObj, GL_INFO_LOG_LENGTH, infoLogLength, 0); - - if(infoLogLength[0]==0) { - return "(InfoLog null)"; - } - int[] charsWritten=new int[1]; - byte[] infoLogBytes = new byte[infoLogLength[0]]; - glGetProgramInfoLog(programObj, infoLogLength[0], charsWritten, 0, infoLogBytes, 0); - - return new String(infoLogBytes, 0, charsWritten[0]); - } - - public boolean glIsShaderStatusValid(int shaderObj, int name) { - return glIsShaderStatusValid(shaderObj, name, null); - } - public boolean glIsShaderStatusValid(int shaderObj, int name, PrintStream verboseOut) { - int[] ires = new int[1]; - glGetShaderiv(shaderObj, name, ires, 0); - - boolean res = ires[0]==1; - if(!res && null!=verboseOut) { - verboseOut.println("Shader status invalid: "+glGetShaderInfoLog(shaderObj)); - } - return res; - } - public boolean glIsShaderStatusValid(IntBuffer shaders, int name) { - return glIsShaderStatusValid(shaders, name, null); - } - public boolean glIsShaderStatusValid(IntBuffer shaders, int name, PrintStream verboseOut) { - boolean res = true; - shaders.rewind(); - while(shaders.hasRemaining()) { - res = glIsShaderStatusValid(shaders.get(), name, verboseOut) && res; - } - shaders.rewind(); - return res; - } - - public boolean glIsProgramStatusValid(int programObj, int name) { - int[] ires = new int[1]; - glGetProgramiv(programObj, name, ires, 0); - - return ires[0]==1; - } - - public boolean glIsProgramValid(int programObj) { - return glIsProgramValid(programObj, null); - } - public boolean glIsProgramValid(int programObj, PrintStream verboseOut) { - int[] ires = new int[1]; - if(!glIsProgram(programObj)) { - if(null!=verboseOut) { - verboseOut.println("Program name invalid: "+programObj); - } - return false; - } - if(!glIsProgramStatusValid(programObj, GL_LINK_STATUS)) { - if(null!=verboseOut) { - verboseOut.println("Program link failed: "+programObj+"\n\t"+ glGetProgramInfoLog(programObj)); - } - return false; - } - if ( !isGLES2() || glShaderCompilerAvailable() ) { - // failed on APX2500 (ES2.0, no compiler) for valid programs - glValidateProgram(programObj); - if(!glIsProgramStatusValid(programObj, GL_VALIDATE_STATUS)) { - if(null!=verboseOut) { - verboseOut.println("Program validation failed: "+programObj+"\n\t"+ glGetProgramInfoLog(programObj)); - } - return false; - } - } - return true; - } - - public void glCreateShader(int type, IntBuffer shaders) { - shaders.clear(); - while(shaders.hasRemaining()) { - shaders.put(glCreateShader(type)); - } - shaders.rewind(); - } - - private Boolean shaderCompilerAvailable = null; - private Set shaderBinaryFormats = null; - - public Set glGetShaderBinaryFormats() - { - if(null==shaderBinaryFormats) { - if(getContext()!=GLContext.getCurrent()) { - return new HashSet(0); // bail out - } - HashSet formatSet = new HashSet(); - - int[] param = new int[1]; - - glGetIntegerv(GL2ES2.GL_NUM_SHADER_BINARY_FORMATS, param, 0); - int numFormats = param[0]; - if(numFormats>0) { - int[] formats = new int[numFormats]; - glGetIntegerv(GL2ES2.GL_SHADER_BINARY_FORMATS, formats, 0); - shaderBinaryFormats = new HashSet(numFormats); - for(int i=0; i<numFormats; i++) { - shaderBinaryFormats.add(new Integer(formats[i])); - } - } else { - shaderBinaryFormats = new HashSet(0); - } - } - return shaderBinaryFormats; - } - - - public boolean glShaderCompilerAvailable() { - if(null==shaderCompilerAvailable) { - if(getContext()!=GLContext.getCurrent()) { - return false; // bail out - } - Set bfs = glGetShaderBinaryFormats(); - if(isGLES2()) { - byte[] param = new byte[1]; - glGetBooleanv(GL2ES2.GL_SHADER_COMPILER, param, 0); - boolean v = param[0]!=(byte)0x00; - if(!v && bfs.size()==0) { - // no supported binary formats, hence a compiler must be available! - v = true; - } - shaderCompilerAvailable = new Boolean(v); - } else if( isGL2() || isGL2ES2() ) { - shaderCompilerAvailable = new Boolean(true); - } else { - throw new GLException("invalid profile"); - } - } - return shaderCompilerAvailable.booleanValue(); - } - - public void glShaderSource(int shader, java.lang.String[] source) - { - if(!glShaderCompilerAvailable()) { - throw new GLException("no compiler is available"); - } - - int count = (null!=source)?source.length:0; - if(count<=0) { - throw new GLException("Method \"glShaderSource\" called with invalid length of source: "+count); - } - IntBuffer length = InternalBufferUtil.newIntBuffer(count); - for(int i=0; i<count; i++) { - length.put(source[i].length()); - } - length.flip(); - glShaderSource(shader, count, source, length); - } - - public void glShaderSource(IntBuffer shaders, java.lang.String[][] sources) - { - int sourceNum = (null!=sources)?sources.length:0; - int shaderNum = (null!=shaders)?shaders.remaining():0; - if(shaderNum<=0 || sourceNum<=0 || shaderNum!=sourceNum) { - throw new GLException("Method \"glShaderSource\" called with invalid number of shaders and/or sources: shaders="+ - shaderNum+", sources="+sourceNum); - } - for(int i=0; i<sourceNum; i++) { - glShaderSource(shaders.get(i), sources[i]); - } - } - - public void glShaderBinary(IntBuffer shaders, int binFormat, java.nio.Buffer bin) - { - if(glGetShaderBinaryFormats().size()<=0) { - throw new GLException("no binary formats are supported"); - } - - int shaderNum = shaders.remaining(); - if(shaderNum<=0) { - throw new GLException("Method \"glShaderBinary\" called with shaders number <= 0"); - } - if(null==bin) { - throw new GLException("Method \"glShaderBinary\" without binary (null)"); - } - int binLength = bin.remaining(); - if(0>=binLength) { - throw new GLException("Method \"glShaderBinary\" without binary (remaining == 0)"); - } - glShaderBinary(shaderNum, shaders, binFormat, bin, binLength); - } - - public void glCompileShader(IntBuffer shaders) - { - shaders.rewind(); - while(shaders.hasRemaining()) { - glCompileShader(shaders.get()); - } - shaders.rewind(); - } - - public void glAttachShader(int program, IntBuffer shaders) - { - shaders.rewind(); - while(shaders.hasRemaining()) { - glAttachShader(program, shaders.get()); - } - shaders.rewind(); - } - - public void glDetachShader(int program, IntBuffer shaders) - { - shaders.rewind(); - while(shaders.hasRemaining()) { - glDetachShader(program, shaders.get()); - } - shaders.rewind(); - } - - public void glDeleteShader(IntBuffer shaders) { - shaders.rewind(); - while(shaders.hasRemaining()) { - glDeleteShader(shaders.get()); - } - shaders.clear(); - } - public void glVertexAttribPointer(GLArrayData array) { if(array.getComponentNumber()==0) return; if(array.isVBO()) { @@ -297,24 +58,3 @@ } } } - - public final String toString() { - StringBuffer buf = new StringBuffer(); - buf.append(getClass().getName()); - if (isGL2ES2()) { - buf.append(" [GLSL compiler: "); - buf.append(glShaderCompilerAvailable()); - Set bfs = glGetShaderBinaryFormats(); - buf.append(", binary formats "); - buf.append(bfs.size()); - buf.append(":"); - for(Iterator iter=bfs.iterator(); iter.hasNext(); ) { - buf.append(" "); - buf.append(((Integer)(iter.next())).intValue()); - } - buf.append("]"); - } - return buf.toString(); - } - - diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java index a7c42a81d..9e2e1f55d 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java @@ -304,10 +304,6 @@ native private long dispatch_glMapBuffer(int target, int access, long glProcAddr native private ByteBuffer newDirectByteBuffer(long addr, int capacity); - public final String toString() { - return getClass().getName(); - } - public void glVertexPointer(GLArrayData array) { if(array.getComponentNumber()==0) return; if(array.isVBO()) { |