Float Buffer Help please

Started by scorpion, June 13, 2006, 18:42:01

Previous topic - Next topic

scorpion

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);

Matzon

you need a lightAmbient1.flip(); before using it