Hi Alexander, I have just done a first pass review and I'm my inclination would be that have a GLObjectsManager signleton that the original osg::flush*() etc functions call for compatibility, then have the GLObjectsManager by default implement the calls to the individual GLobject types. The GLObjectsManager singleton would also be open to being overridden by user applications that would subclass the GLObjectsManager and extend it as required.
I would also add that you are the first user to raise this issue so it's very much a niche one, solving it elegantly still needs to happen but we have to try and keep any additions very succinct and clean. Cheers, Robert. On 10 May 2014 20:53, Alexander Sinditskiy <[email protected]> wrote: > Hello, > > Recently I had issue with integration 3rdparty opengl library as osg drawable. > > It is very difficult to cache and handle destroying of external gl objects > now. It is not possible to use incremental compile operation for delete > external objects, and also it is difficult to handle context destroy for > cache clearing. > > I created GLObjectsManagerInterface that provide ability to handle > flush/delete/discard and solve issue. > > I attached changed files and git patch. > > Also I see that osg have many similar managers, but it use static function > calls: > > > Code: > > osg::GLBufferObject::discardAllBufferObjects(contextID); > osg::Texture::discardAllTextureObjects(contextID); > > osg::FrameBufferObject::discardDeletedFrameBufferObjects(contextID); > osg::Program::discardDeletedGlPrograms(contextID); > osg::RenderBuffer::discardDeletedRenderBuffers(contextID); > osg::Shader::discardDeletedGlShaders(contextID); > osg::OcclusionQueryNode::discardDeletedQueryObjects(contextID); > > > I think we may change existing calls to similar GLObjectsManagerInterfaces, > what do you think? > > Thank you! > > Cheers, > Alexander[/code] > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=59342#59342 > > > > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
