Use osgDB::SharedStateManager for sharing of StateSets across NIF files

c++11
scrawl 10 years ago
parent 1c151f2f0a
commit 6199c0bbc5

@ -8,6 +8,9 @@
#include <osgUtil/IncrementalCompileOperation>
#include <osgDB/SharedStateManager>
#include <osgDB/Registry>
#include <components/nifosg/nifloader.hpp>
#include <components/nif/niffile.hpp>
@ -103,6 +106,9 @@ namespace Resource
NifOsg::Loader loader;
osg::ref_ptr<osg::Node> loaded = loader.load(Nif::NIFFilePtr(new Nif::NIFFile(file, normalized)), mTextureManager);
osgDB::Registry::instance()->getOrCreateSharedStateManager()->share(loaded.get());
// TODO: run SharedStateManager::prune on unload
if (mIncrementalCompileOperation)
mIncrementalCompileOperation->add(loaded);

Loading…
Cancel
Save