Texture problems after refactoring to use direct buffers in lwjgl 2.3.0

Started by TilmannZ, February 23, 2010, 00:19:42

Previous topic - Next topic


Yesterday I installed the new ATI 10.2 driver (up from 9.12) and promptly ran into the problem that you guys already fixed in 2.3.
It turned out I also had to migrate all usage of Byte/Float/Double/IntBuffers to use direct buffers.

Now the problem is that no objects are displayed anymore. I still see the ground and sky (with texture) and shadows of objects.
But objects themselves are gone, instead I see occasional large (25%-75% of the display) black or grey triangles flickering randomly.
One difference between ground/sky/shadow and object display is that I use
      GL11.glMultMatrix (matrixD);   //matrixD being a DoubleBuffer
      GL11.glMultMatrix (matrixF);   //matrixF being a FloatBuffer
which are not used in ground/sky display.

I've been checking again and again and again, but I'm sure my refactoring from normal to direct buffers is correct.

Is it possible that some other change has been introduced between 2.2.1 and 2.3?
I don't mean necessarily a bug in lwjgl 2.3; chances are that I was doing something incorrect before the refactoring, and now a change in the 2.3 made lwjgl refuse to work with my previously incorrect code.
Any ideas what might be going on?

I only use lwjgl for demonstration purpose, therefore I'm not very experienced and was never concerned with performance either.

I'm on 64bit SUSE Linux, using an 10.2 ATI driver on HD 3850.



You could try to revert to the previous version of lwjgl and use your current code to check of you made a mistake while porting your code.
When I am king, they shall not have bread and shelter only, but also teachings out of books, for a full belly is little worth where the mind is starved - Mark Twain


please make sure to flip your buffers. .wrap did that for you with the old indirect buffers.


It sounds to me like you've forgotten to call order(ByteOrder.nativeOrder()) on all those direct bytebuffers.

Cas :)


Indeed (as I saw also in another Thread) I had forgotten to set the byte order.


I then chose to use org.lwjgl.BufferUtils which is indeed quite helpful.

Thanks to all,