I want to draw a cube by using lwjgl, an error was thrown when using glBegin():
my codes:
glBegin(GL_TRIANGLES);
// top
glVertex3f(-x, y, z);
glVertex3f(-x, y, -z);
glVertex3f(x, y, -z);
glVertex3f(x, y, z);
glVertex3f(-x, y, z);
glVertex3f(x, y, -z);
my errors:
java.lang.IllegalStateException: Function is not supported
at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:58)
at org.lwjgl.opengl.GL11.glBegin(GL11.java:682)
Functions that are part of “Immediate Mode” are deprecated, and are not available with OpenGL 3.1 core profile. You need to be running with “compatibility profile.”
There is a link to this information in the LWJGL javadoc for GL11.