@Override public String glGetProgramInfoLog(int program, int maxSize) { ByteBuffer buffer = ByteBuffer.allocateDirect(maxSize); buffer.order(ByteOrder.nativeOrder()); ByteBuffer tmp = ByteBuffer.allocateDirect(4); tmp.order(ByteOrder.nativeOrder()); IntBuffer intBuffer = tmp.asIntBuffer(); GLContext.getCurrentGL().getGL2ES2().glGetProgramInfoLog(program, maxSize, intBuffer, buffer); int numBytes = intBuffer.get(0); byte[] bytes = new byte[numBytes]; buffer.get(bytes); return new String(bytes); }
@Override public String getProgramInfoLog(int program) { int[] val = { 0 }; gl2.glGetProgramiv(program, GL2ES2.GL_INFO_LOG_LENGTH, val, 0); int length = val[0]; if (0 < length) { byte[] log = new byte[length]; gl2.glGetProgramInfoLog(program, length, val, 0, log, 0); return new String(log); } else { return "Unknown error"; } }
@Override public String glGetProgramInfoLog(int program, int maxSize) { ByteBuffer buffer = ByteBuffer.allocateDirect(maxSize); buffer.order(ByteOrder.nativeOrder()); ByteBuffer tmp = ByteBuffer.allocateDirect(4); tmp.order(ByteOrder.nativeOrder()); IntBuffer intBuffer = tmp.asIntBuffer(); GLContext.getCurrentGL().getGL2ES2().glGetProgramInfoLog(program, maxSize, intBuffer, buffer); int numBytes = intBuffer.get(0); byte[] bytes = new byte[numBytes]; buffer.get(bytes); return new String(bytes); }
public static String getProgramInfoLog(final GL _gl, final int programObj) { final GL2ES2 gl = _gl.getGL2ES2(); final int[] infoLogLength=new int[1]; gl.glGetProgramiv(programObj, GL2ES2.GL_INFO_LOG_LENGTH, infoLogLength, 0); if(infoLogLength[0]==0) { return "(no info log)"; } final int[] charsWritten=new int[1]; final byte[] infoLogBytes = new byte[infoLogLength[0]]; gl.glGetProgramInfoLog(programObj, infoLogLength[0], charsWritten, 0, infoLogBytes, 0); return new String(infoLogBytes, 0, charsWritten[0]); }
public static String getProgramInfoLog(final GL _gl, final int programObj) { final GL2ES2 gl = _gl.getGL2ES2(); final int[] infoLogLength=new int[1]; gl.glGetProgramiv(programObj, GL2ES2.GL_INFO_LOG_LENGTH, infoLogLength, 0); if(infoLogLength[0]==0) { return "(no info log)"; } final int[] charsWritten=new int[1]; final byte[] infoLogBytes = new byte[infoLogLength[0]]; gl.glGetProgramInfoLog(programObj, infoLogLength[0], charsWritten, 0, infoLogBytes, 0); return new String(infoLogBytes, 0, charsWritten[0]); }
protected void checkProgramThrowException(GL2ES2 gl, int programId, int statusFlag) { int[] result = new int[1]; gl.glGetProgramiv(programId, statusFlag, result, 0); if (result[0] == GL.GL_TRUE) { return; } gl.glGetProgramiv(programId, GL2ES2.GL_INFO_LOG_LENGTH, result, 0); int size = result[0]; byte[] data = new byte[size]; gl.glGetProgramInfoLog(programId, size, result, 0, data, 0); String error = new String(data, 0, result[0]); throw new ShaderException(error); } }
protected void checkProgramThrowException(GL2ES2 gl, int programId, int statusFlag) { int[] result = new int[1]; gl.glGetProgramiv(programId, statusFlag, result, 0); if (result[0] == GL.GL_TRUE) { return; } gl.glGetProgramiv(programId, GL2ES2.GL_INFO_LOG_LENGTH, result, 0); int size = result[0]; byte[] data = new byte[size]; gl.glGetProgramInfoLog(programId, size, result, 0, data, 0); String error = new String(data, 0, result[0]); throw new ShaderException(error); } }