Hi Roccardo,

osgDB::Registry is the low level hooks for all the plugins so doesn't
attempt to wrap up too much high level functionality.  If you wish to
apply the SharedStateManager to all model calls you could write a
custom Registry::ReadFileCallback that loads a model then does the
share on it.

Robert.

On 21 December 2011 14:59, Riccardo Corsi <riccardo.co...@kairos3d.it> wrote:
> Hi All,
>
> in the attempt of enabling texture sharing when loading a scene at
> application startup,
> I've tried to use the SharedStateManager class as suggested in other posts,
> creating an instance of it in the Registry via:
> Registry::instance()->getOrCreateSharedStateManager()
>
> But after checking the code I've realized the SharedStateManager is used
> only by the DatabasePager when merging new subgraphs,
> and not by the Registry itself in methods like readNode()/Image/etc...
> which means that direct calls to load new objects don't make use of the
> state sharing.
>
> Is this the intended behaviour?
> I'd have expected that installing a sharing manager into the Registry would
> have influenced all calls that load some resource.
>
> Of course the "workaround" is to add somewhere an explicit call
> to SharedStateManager->share(),
> but I wanted to understand why the sharing mechanism is not used by the
> Registry automatically.
>
> Thank you,
> Ricky
>
>
>
> _______________________________________________
> 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

Reply via email to