function not supported for no reason

Started by leejenshil, August 21, 2015, 14:12:01

Previous topic - Next topic

leejenshil

in my voxel engine, i am trying to render a simple chunk. i have set up the VBO's and put all the vertices in it, but when i go to render it using these lines:

GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
	    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, chunk.getVBOVertexHandle());
	    GL11.glVertexPointer(3, GL11.GL_FLOAT, 0, 0);
	     
	    GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
	    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, chunk.getVBOColorHandle());
	    GL11.glColorPointer(4, GL11.GL_FLOAT, 0, 0);
            GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, chunk.getVertexCount());


it just gives me an Exception in thread "main" java.lang.IllegalStateException: Function is not supported coming from every GL11 function in that block code that's not glDrawArrays. what's weirder is that i'm following this tutorial on how to make a voxel engine and when i downloaded the source from that site and ran it there where no errors. so i copy pasted most of the code and i still got the error! any idea what could make the error?

spasi