Hello Guest

[SOLVED] VBO issue - having trouble with rendering

  • 0 Replies
  • 5076 Views
*

Offline Suds

  • *
  • 11
[SOLVED] VBO issue - having trouble with rendering
« on: October 13, 2011, 07:04:55 »
Hey, I'm experimenting with setting up a VBO to render my (cube based) world. This code should draw a cube (at least that's the intention), it generates no errors:

http://pastebin.com/UrqHLmb7

I've been over the code on "Using Vertex Buffer Objects" at http://lwjgl.org/wiki/index.php?title=Using_Vertex_Buffer_Objects_(VBO) a fair few times now. The trouble I am having, is that my game does not draw a cube at all. There are two classes in that paste - the VBOHandler class that I wrote is at the bottom. To rule out camera issues, I set up a camera that points at a reference grid around the origin too. This is what my game sees http://dl.dropbox.com/u/18809996/game.png

The reference grid is made with just plain vertices - not buffered, not using an index buffer, nothing. Just vertices.

Can anyone see what is wrong with my code there?

EDIT: My issue was solved on this cross post http://www.java-gaming.org/index.php/topic,24915.msg212630.html#msg212630

I just needed to flip buffers, and I had forgotten to actually VBOHandler.bufferData(_coloursID, bufferedColours);
« Last Edit: October 13, 2011, 10:17:20 by Suds »