]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/util/StateAttributeFactory.cxx
Use osg's builtin mechanisms to traverse only in range nodes with the
[simgear.git] / simgear / scene / util / StateAttributeFactory.cxx
index 902379606c859787f51dc636c9c375120e166dcb..6e121c073d0d7765c102bccddfc32311ccbffe5d 100644 (file)
  * MA 02110-1301, USA.
  *
  */
+#include "StateAttributeFactory.hxx"
 
-#include <OpenThreads/ScopedLock>
+#include <osg/AlphaFunc>
+#include <osg/Array>
+#include <osg/BlendFunc>
+#include <osg/CullFace>
+#include <osg/Depth>
+#include <osg/ShadeModel>
+#include <osg/Texture2D>
+#include <osg/TexEnv>
 
 #include <osg/Image>
-#include "StateAttributeFactory.hxx"
 
 using namespace osg;
 
@@ -64,17 +71,8 @@ StateAttributeFactory::StateAttributeFactory()
     _cullFaceFront->setDataVariance(Object::STATIC);
     _cullFaceBack = new CullFace(CullFace::BACK);
     _cullFaceBack->setDataVariance(Object::STATIC);
+    _depthWritesDisabled = new Depth(Depth::LESS, 0.0, 1.0, false);
+    _depthWritesDisabled->setDataVariance(Object::STATIC);
 }
 
-osg::ref_ptr<StateAttributeFactory> StateAttributeFactory::_theInstance;
-OpenThreads::Mutex StateAttributeFactory::_instanceMutex;
-
-StateAttributeFactory* StateAttributeFactory::instance()
-{
-    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_instanceMutex);
-    if (!_theInstance.valid()) {
-        _theInstance = new StateAttributeFactory;
-    }
-    return _theInstance.get();
-}
 }