LWJGL Forum

Programming => OpenGL => Topic started by: Eistoeter on February 23, 2010, 16:05:48

Title: Problem migrating to direct buffers
Post by: Eistoeter on February 23, 2010, 16:05:48
Hello,

I've updated to LWJGL 2.3 and can't get my buffers working correctly. I got exceptions that LWJGL does no longer support indirect buffers so I updated my buffers.

The problem is, that I don't get anything displayed on the screen the way it should be. Now I only get bizzare graphic errors. Here is my code as it was before:

FloatBuffer buf = FloatBuffer.allocate(16);
getLocalRotationMatrix().store(buf);
buf.flip();
GL11.glMultMatrix(buf);


and here the new code:

ByteBuffer byteBuffer = ByteBuffer
.allocateDirect((Float.SIZE / 8) * 16);
FloatBuffer floatBuffer = byteBuffer.asFloatBuffer();
getLocalRotationMatrix().store(floatBuffer);
floatBuffer.flip();
GL11.glMultMatrix(floatBuffer);


Can you tell me what I do wrong?
Title: Re: Problem migrating to direct buffers
Post by: Eistoeter on February 23, 2010, 16:13:11
Solved using BufferUtils