Question on VBO

hello there…

I want to use VBOs for optimization of displaying data… Now i went through many tutorials… So, my concept (theoretically) is clear… I mean which function does what task and all i know…

But only thing is am confused where to write the code… Now in my case, i have, base class called Objects, and am deriving various objects from this, like, Circle, Rectangle, Lines and points… And each of these classes are having their own Render function… In my paint event of GLCanvas, i call a function which in turn traverses a list of objects and calls their corresponding render functions…

void MainRender()
{
for(std::map<unsigned int, EObjects *>::iterator it = ObjList.begin(); it != ObjList.end(); it++)
{
(*it)->Render();
}
}

Now, glGenBuffer() has to be called only once… So i guess it will be ok if i call it in the constructor of GLcanvas class… Secondly, where do i write a code for binding of buffer and data.?? in the corresponding classes render event or in the MainRender() function…???

Can anyone please help me to how to proceed with…??

Thanks in advance…

Regards
Rakesh Patil

you may also know which function where fitted
i hope you have seen songho and might as it at first place by google search

www.songho.ca/opengl/gl_vbo.html

but i hope you also go at
http://www.opengl.org/registry/specs/ARB/vertex_buffer_object.txt

there is simple way
DrawArrays
and other bla-bla in the above opengl extension

hey dude… thanks for a quick reply… I’ll definitely go through those links…

Thanks once again…

Hi…

How can i select a primitive when i’m rendering objects using VBOs…??

Thanks

http://www.opengl.org/wiki/Common_Mistakes#Selection_and_Picking_and_Feedback_Mode