I just solved a bug and I'm not sure why. Creating a 4x4 projection matrix in LWJGL, for use in a vertex shader..
This line causes problems. It fails silently and my mat4 in the shader is stuck as all zeros (as if it was never written).
FloatBuffer mProj = ByteBuffer.allocate(4*16).asFloatBuffer();
This works as expected.
FloatBuffer mProj = BufferUtils.createFloatBuffer(16);
As a sanity-check, I confirmed that my floats are 4 bytes. So what's the difference?
BufferUtils? A lwjgl class?org.lwjgl.BufferUtils