예제 #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;
  }
예제 #2
0
파일: Box.java 프로젝트: seraf8/irr310
  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;
  }
예제 #3
0
 private String getLogInfo(final int obj) {
   return ARBShaderObjects.glGetInfoLogARB(
       obj,
       ARBShaderObjects.glGetObjectParameteriARB(
           obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB));
 }