Ejemplo n.º 1
0
  public static boolean isProgramStatusValid(final GL _gl, final int programObj, final int name) {
    final GL2ES2 gl = _gl.getGL2ES2();
    final int[] ires = new int[1];
    gl.glGetProgramiv(programObj, name, ires, 0);

    return ires[0] == 1;
  }
Ejemplo n.º 2
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]);
  }