Is there anything wrong in the way I try to draw VBOs/IBOs? I only manage to get random lines on the screen that appear and disappear every other frame.
Here is the code to create them:
// VBO
glGenBuffers(1, &VBOID);
glBindBuffer(GL_ARRAY_BUFFER, VBOID);
glBufferData(GL_ARRAY_BUFFER, VBOSizesizeof(float), NULL, GL_STATIC_DRAW);
glBufferSubData(GL_ARRAY_BUFFER, 0, VBOSizesizeof(GLushort), VBO);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glGenBuffers(1, &IBOID);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBOID);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, IBOSizesizeof(GLuint), NULL, GL_STATIC_DRAW);
glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, IBOSizesizeof(GLushort), IBO);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
// end VBO
And here the way I draw them:
// Draw VBO
glEnableClientState(GL_VERTEX_ARRAY); // enable array states
glBindBuffer(GL_ARRAY_BUFFER, VBOID); // binding the VBO and assign NULL to the vertex pointer
glVertexPointer(3, GL_FLOAT, 0, NULL);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBOID); // binding the VBO and assign NULL to the vertex pointer
glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, NULL); // draw elements in the IBO
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); // debind IBO
glBindBuffer(GL_ARRAY_BUFFER, 0); // debind VBO
glDisableClientState(GL_VERTEX_ARRAY); // disable array states
//
Here is the complete source:
http://pastebin.com/f12db0631