Hi Alexandre, On 15 January 2013 12:47, Alexandre Valdetaro <osgfo...@tevs.eu> wrote: > Sorry about this delay, i did not notice when i looked and the > compileGLObjects method that it was also const, which still confuses me. > > First of all thanks for the explanation! > Still, how is one supposed to create any opengl element (VBOs, textures...) > to use inside the drawImplementation method when overriding it? I apologize > if it is something simple and i am not seeing it, but i havent found an > example that has such scenario. If there is one, could someone please point > me to it?
The compileGLObjects() and draw/drawImplementation() methods are const to give a strong hint to the developer that these classes can be run multi-threaded and should not usually modify local data. For data like OpenGL objects one does need to modify it during the draw calls but these are the exception and have to be multi-buffered with one element in each buffer used for each graphics context, as each graphics thread has at most one thread the thread safety is not compromised as long as the buffers used are pre-allocated to be big enough to contain all the elements required. Does this make sense? Robert. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org