LWJGL Forum

Programming => OpenGL => Topic started by: scorpion on June 13, 2006, 18:42:01

Title: Float Buffer Help please
Post by: scorpion on June 13, 2006, 18:42:01
I don't get this to work properly! Tells me:
"Number of remaining buffer elements is 0, must be at least 4"

Could someone help?

FloatBuffer lightAmbient1 = BufferUtils.createFloatBuffer(4).put(new float[] { 0.5f, 0.5f, 0.5f, 1.0f });

GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, lightAmbient1);
Title: Float Buffer Help please
Post by: Matzon on June 13, 2006, 19:57:33
you need a lightAmbient1.flip(); before using it