LWJGL
May 22, 2012, 05:08:04 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.8.3 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Problem migrating to direct buffers  (Read 702 times)
Eistoeter
Newbie
*
Posts: 15


« on: February 23, 2010, 08: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:
Code:
FloatBuffer buf = FloatBuffer.allocate(16);
getLocalRotationMatrix().store(buf);
buf.flip();
GL11.glMultMatrix(buf);

and here the new code:
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?
Logged
Eistoeter
Newbie
*
Posts: 15


« Reply #1 on: February 23, 2010, 08:13:11 »

Solved using BufferUtils
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!