I’m using
FloatBuffer ambient=FloatBuffer.allocate(4);
ambient.put(new float[]{0.05f, 0.05f, 0.05f, 0.0f});
…
gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient);
…
It doesn’t work, my scene remains unlit.
When I replace the call with
gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient.array(),0);
It works fine.
Is there something wrong with the first way of calling it?