LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: cfmdobbie on February 20, 2004, 13:56:23

Title: Vertex Arrays - Arrrrghh!
Post by: cfmdobbie on February 20, 2004, 13:56:23
There was a long post here asking questions about vertex arrays and what the hell I'm doing wrong.  I'm porting a huge piece of technology built on JoGL and a straight port was failing to display anything on the screen, I'd even chucked the whole lot out and started again, just to be sure I'd converted the few calls that have different syntax correctly.

Well, it now works to some extent, and the lesson I've learned today is:

If you're being given a ByteBuffer by someone else's technology, rewind the damn thing before you start as you're almost guaranteed its position will be equal to its limit.

Arrrgh!  You have no idea how long this problem has blocked me...
Title: Vertex Arrays - Arrrrghh!
Post by: Matzon on February 20, 2004, 14:18:16
hehe, this is kinda an universal bug :) - I have seen it countless times, and not just with byte buffers!
Title: Vertex Arrays - Arrrrghh!
Post by: princec on February 20, 2004, 15:06:53
Just be thankful you ain't been handed a pointer that someone's forgotten to rewind...

Cas ;)