I'm still having trouble dealing with "pointers" in LWJGL. Specifically, my current issue:

I'm trying to use some billboarding, so I need to retrieve the model view matrix using glGetFloatv...

Here's what I tried to do:

1 2 3 4 5
| float[] matrix = new float[16]; FloatBuffer buf = ByteBuffer.allocateDirect(16*4).order(ByteOrder.nativeOrder()).asFloatBuffer(); buf.put(matrix); int bufPtr = Sys.getDirectBufferAddress(buf); gl.getFloatv(GL.MODELVIEW_MATRIX, bufPtr); |

yet, matrix is still filled with 0's. I'm assuming that I am not filling the matrix correctly, but I thought that was the point of getting the pointer.

What am I forgetting/doing wrong?