#include <boost/functional/hash.hpp>
#include <osg/Object>
+#include <osg/observer_ptr>
#include <osgDB/ReaderWriter>
#include <simgear/props/props.hxx>
{
class Technique;
class Effect;
-class SGReaderWriterXMLOptions;
+class SGReaderWriterOptions;
/**
* Object to be initialized at some point after an effect -- and its
/**
* Build the techniques from the effect properties.
*/
- bool realizeTechniques(const SGReaderWriterXMLOptions* options = 0);
+ bool realizeTechniques(const SGReaderWriterOptions* options = 0);
/**
* Updaters that should be derefed when the effect is
* deleted. Updaters arrange to be run by listening on properties
bool operator()(const Key& lhs, const Key& rhs) const;
};
};
- typedef std::tr1::unordered_map<Key, osg::ref_ptr<Effect>,
+ typedef std::tr1::unordered_map<Key, osg::observer_ptr<Effect>,
boost::hash<Key>, Key::EqualTo> Cache;
Cache* getCache()
{
Cache* _cache;
friend size_t hash_value(const Key& key);
friend Effect* makeEffect(SGPropertyNode* prop, bool realizeTechniques,
- const SGReaderWriterXMLOptions* options);
+ const SGReaderWriterOptions* options);
bool _isRealized;
};
// Automatic support for boost hash function
Effect* makeEffect(const std::string& name,
bool realizeTechniques,
- const SGReaderWriterXMLOptions* options = 0);
+ const SGReaderWriterOptions* options);
Effect* makeEffect(SGPropertyNode* prop,
bool realizeTechniques,
- const SGReaderWriterXMLOptions* options = 0);
+ const SGReaderWriterOptions* options);
bool makeParametersFromStateSet(SGPropertyNode* paramRoot,
const osg::StateSet* ss);
+void clearEffectCache();
+
namespace effect
{
/**