throw new GLException(message);
}
public void validate() {
if (isDisposed()) {
throw new GLException();
}
glInvoke("glValidateProgram", int.class, getId());
int[] status = new int[1];
glInvoke("glGetProgramiv",
int.class, getId(),
int.class, GL3.GL_VALIDATE_STATUS,
int[].class, status,
int.class, 0
);
if (status[0] == GL.GL_TRUE) {
return;
}
int[] length = new int[1];
glInvoke("glGetProgramiv",
int.class, getId(),
int.class, GL3.GL_INFO_LOG_LENGTH,
int[].class, length,
int.class, 0
);
byte[] chars = new byte[length[0]];
glInvoke("glGetProgramInfoLog",
int.class, getId(),
int.class, length[0],
int[].class, length,
int.class, 0,
byte[].class, chars,
int.class, 0
);
String message = new String(chars, Charset.forName("utf-8"));
throw new GLException(message);
}