Exemplo n.º 1
0
  private static boolean printLogInfo(int obj) {
    IntBuffer iVal = BufferUtils.createIntBuffer(1);
    glGetObjectParameterARB(obj, GL_OBJECT_INFO_LOG_LENGTH_ARB, iVal);

    int length = iVal.get();
    if (length > 1) {
      ByteBuffer infoLog = BufferUtils.createByteBuffer(length);
      iVal.flip();
      glGetInfoLogARB(obj, iVal, infoLog);
      byte[] infoBytes = new byte[length];
      infoLog.get(infoBytes);
      String out = new String(infoBytes);
      System.out.println("Info log:\n" + out);
      return false;
    }
    return true;
  }
Exemplo n.º 2
0
  private static boolean printLogInfo(int obj, String filename) {
    IntBuffer iVal = BufferUtils.createIntBuffer(1);
    ARBShaderObjects.glGetObjectParameterARB(
        obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB, iVal);

    int length = iVal.get();
    if (length > 1) {
      // We have some info we need to output.
      ByteBuffer infoLog = BufferUtils.createByteBuffer(length);
      iVal.flip();
      ARBShaderObjects.glGetInfoLogARB(obj, iVal, infoLog);
      byte[] infoBytes = new byte[length];
      infoLog.get(infoBytes);
      String out = new String(infoBytes);
      System.out.println("Info log for " + filename + ":\n" + out);
    } else return true;
    return false;
  }
Exemplo n.º 3
0
 private String getLogInfo(final int obj) {
   return ARBShaderObjects.glGetInfoLogARB(
       obj,
       ARBShaderObjects.glGetObjectParameteriARB(
           obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB));
 }