Hi Alexandre, All OpenGL calls have be done from a thread with a valid graphics context current, as the OSG allows multi-threaded, multi-context usage one has to be careful when and where you do OpenGL calls. For a Drawable the three times when it's guaranteed to be safe to do OpenGL calls is when overriding the Drawable::compileGLObjects() or drawImplementation() or when using a DrawCallback.
Robert. On 7 December 2012 01:39, Alexandre Valdetaro <osgfo...@tevs.eu> wrote: > Hi, > > I just figured out that i was having a lot of trouble when creating vbos > inside a drawable because there was no opengl context set during its > initialization. > > After searching for a while i found out that if i initialized the vbos > inside drawImplementation method then everything would work. There is one > problem however, drawImplementation is const. > > I ended up setting all my members to mutable and all my methods to const > so i could make it work. And now it is working. > > Isn't there a more proper way of initializing stuff inside a drawable? I > would expect a initialize method or something like it, or a non const > drawImplementation method. > > I also tried to set the context before initializing the drawable without > using the drawImplementation method to no avail. > > Thanks a lot fellows > > Cheers, > Alexandre > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=51451#51451 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org