View Full Version : Problem with VBO

05-22-2011, 01:19 PM
Hi everyone,
at the beginning I want to say "Hello", as this is my first post :)

Ok. I have a problem in rendering objects from the graphic card's buffer. I am making a simple framework and I wanted to speed-up my applications. I made everything according to these tutorials: http://www.opengl.org/wiki/Vertex_Buffer_Object and http://sdickinson.com/wordpress/?p=122. (http://sdickinson.com/wordpress/?p=122) There are some parts of code that are resposible for allocating space on buffer, copying the vertices and rendering the objects:
Mesh.h: http://pastebin.com/azePp45c
Mesh.cpp: http://pastebin.com/pJSEpvvG
Vertex.h: http://pastebin.com/pjqVHST5
If you need more source, tell me, I'll upload it.

And what is the problem? Object loads fine (I made a simple Wavefront's .obj files loader, based on std::map - I checked it thousand times! It works.), and the data is being sent to VBO with no problems at all. bufferSize tells what it should - according to sizeof, class Vertex has 32 bytes of size - including Position (12 bytes), TexCoords (8 bytes) and Normal(12 bytes). For 4 Vertices and 6 indexes it allocates 128 bytes + 12 bytes. This is good, isn't it? Ok, but the object does not appear on the scene. Without using the VBO it is ok, shaders work, colors work, animation works, too. With VBO there's just nothing. But it does something, because FPSs are counting. I am working on that for 3 days and I am slowly surrending. Please, help me.
I am using Gentoo Linux x86_64 with ATI HD5450, ati-drivers-11.5.