Hi Robert,

thank you for the clarification, I just wanted to make sure that was the
intended behavior.

I was mislead by this message thread:
http://forum.openscenegraph.org/viewtopic.php?p=30417
in which it seems that installing the ShareStateManager in the Registry
is enough to obtain the sharing feature.

Thanks,
Ricky


On Thu, Jan 5, 2012 at 21:35, Robert Osfield <[email protected]>wrote:

> 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 <[email protected]>
> 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
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to