Hi Lionel, On 14 December 2012 10:07, Lionel Lagarde <lionel.laga...@oktal-se.fr>wrote:
> Hi Robert, > > Proposal: > > new member: BufferData::_numUsers initialized to > BufferData::getReferenceCount when the GL buffer object is created and > filled > > In Texture:apply, decrement the _numUsers member of the Image and release > the GL buffer object if the sum of the _numUsers of all the BufferData > contained if the GL buffer object is 0 > > Any thoughts ? > Doesn't feel elegant to me. I wonder if we could unref the BufferData by removing it form the osg::Image and let it's ref count control it's destruction, and when it destructs it'll destruct the PixelBufferObject if it no longer has any references. This would be a bit similar to the way that the osg::Image is unref'd. Like this mechanism we'd need to make sure that the BufferData is applied to all the contexts that require it. Robert.
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org