]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/material/Effect.hxx
Work around apparent OSG 3.2.0 normal binding bug.
[simgear.git] / simgear / scene / material / Effect.hxx
index 6daa279f157e0eb86bb56a3ed7f65be1e14a97f8..0966dc1aa63e8b7d9bcba911b90e44af12cf4f64 100644 (file)
@@ -24,6 +24,7 @@
 #include <boost/functional/hash.hpp>
 
 #include <osg/Object>
+#include <osg/observer_ptr>
 #include <osgDB/ReaderWriter>
 
 #include <simgear/props/props.hxx>
@@ -81,18 +82,6 @@ public:
            const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
     osg::StateSet* getDefaultStateSet();
 
-    enum Buffer
-    {
-        DEPTH_BUFFER,
-        NORMAL_BUFFER,
-        DIFFUSE_BUFFER,
-        SPEC_EMIS_BUFFER,
-        LIGHTING_BUFFER,
-        MIDDLE_BLOOM_BUFFER,
-        BLOOM_BUFFER,
-        AO_BUFFER
-    };
-
     // Define what needs to be generated for this effect
     enum Generator
     {
@@ -158,7 +147,7 @@ protected:
             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()
     {
@@ -178,15 +167,17 @@ size_t hash_value(const Effect::Key&);
 
 Effect* makeEffect(const std::string& name,
                    bool realizeTechniques,
-                   const SGReaderWriterOptions* options = 0);
+                   const SGReaderWriterOptions* options);
 
 Effect* makeEffect(SGPropertyNode* prop,
                    bool realizeTechniques,
-                   const SGReaderWriterOptions* options = 0);
+                   const SGReaderWriterOptions* options);
 
 bool makeParametersFromStateSet(SGPropertyNode* paramRoot,
                                 const osg::StateSet* ss);
 
+void clearEffectCache();
+
 namespace effect
 {
 /**