From 862a827fe602acdf893da424e07af26294dbd834 Mon Sep 17 00:00:00 2001
From: timoore <timoore>
Date: Wed, 10 Dec 2008 22:38:14 +0000
Subject: [PATCH] Add cullFaceFront as a state attribute to the
 StateAttributeFactory

---
 simgear/scene/util/StateAttributeFactory.cxx | 2 ++
 simgear/scene/util/StateAttributeFactory.hxx | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/simgear/scene/util/StateAttributeFactory.cxx b/simgear/scene/util/StateAttributeFactory.cxx
index 30407b05..90237960 100644
--- a/simgear/scene/util/StateAttributeFactory.cxx
+++ b/simgear/scene/util/StateAttributeFactory.cxx
@@ -60,6 +60,8 @@ StateAttributeFactory::StateAttributeFactory()
     _white = new Vec4Array(1);
     (*_white)[0].set(1.0f, 1.0f, 1.0f, 1.0f);
     _white->setDataVariance(Object::STATIC);
+    _cullFaceFront = new CullFace(CullFace::FRONT);
+    _cullFaceFront->setDataVariance(Object::STATIC);
     _cullFaceBack = new CullFace(CullFace::BACK);
     _cullFaceBack->setDataVariance(Object::STATIC);
 }
diff --git a/simgear/scene/util/StateAttributeFactory.hxx b/simgear/scene/util/StateAttributeFactory.hxx
index c638108c..0a7809dd 100644
--- a/simgear/scene/util/StateAttributeFactory.hxx
+++ b/simgear/scene/util/StateAttributeFactory.hxx
@@ -49,7 +49,8 @@ public:
     osg::Texture2D* getWhiteTexture() { return _whiteTexture.get(); }
     // White color
     osg::Vec4Array* getWhiteColor() {return _white.get(); }
-    // cull back facing polygons
+    // cull front and back facing polygons
+    osg::CullFace* getCullFaceFront() { return _cullFaceFront.get(); }
     osg::CullFace* getCullFaceBack() { return _cullFaceBack.get(); }
     
     static StateAttributeFactory* instance();
@@ -62,6 +63,7 @@ protected:
     osg::ref_ptr<osg::TexEnv> _standardTexEnv;
     osg::ref_ptr<osg::Texture2D> _whiteTexture;
     osg::ref_ptr<osg::Vec4Array> _white;
+    osg::ref_ptr<osg::CullFace> _cullFaceFront;
     osg::ref_ptr<osg::CullFace> _cullFaceBack;
     static osg::ref_ptr<StateAttributeFactory> _theInstance;
     static OpenThreads::Mutex _instanceMutex;
-- 
2.39.5