Changeset 11202

Show
Ignore:
Timestamp:
03/11/10 17:46:01 (3 years ago)
Author:
robert
Message:

Clean up of initialization of statics/use of getenv

Location:
OpenSceneGraph/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgUtil/RenderBin

    r10275 r11202  
    170170}; 
    171171 
    172 /** Proxy class for automatic registration of renderbins with the RenderBin prototypelist.*/ 
    173 class RegisterRenderBinProxy 
    174 { 
    175     public: 
    176         RegisterRenderBinProxy(const std::string& binName,RenderBin* proto) 
    177         { 
    178             _rb = proto; 
    179             RenderBin::addRenderBinPrototype(binName,_rb.get()); 
    180         } 
    181  
    182         ~RegisterRenderBinProxy() 
    183         { 
    184             RenderBin::removeRenderBinPrototype(_rb.get()); 
    185         } 
    186          
    187     protected: 
    188         osg::ref_ptr<RenderBin> _rb; 
    189 }; 
    190  
    191  
    192172} 
    193173 
  • OpenSceneGraph/trunk/src/osg/DisplaySettings.cpp

    r10774 r11202  
    608608 
    609609} 
    610  
    611  
    612  
  • OpenSceneGraph/trunk/src/osg/Geometry.cpp

    r10874 r11202  
    536536bool Geometry::computeFastPathsUsed() 
    537537{ 
    538     static bool s_DisableFastPathInDisplayLists = getenv("OSG_DISABLE_FAST_PATH_IN_DISPLAY_LISTS")!=0; 
    539     if (_useDisplayList && s_DisableFastPathInDisplayLists) 
    540     { 
    541         osg::notify(osg::DEBUG_INFO)<<"Geometry::computeFastPathsUsed() - Disabling fast paths in display lists"<<std::endl; 
    542         _supportsVertexBufferObjects = _fastPath = false; 
    543         return _fastPath; 
    544     } 
    545  
    546538    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
    547539    // 
  • OpenSceneGraph/trunk/src/osgUtil/RenderBin.cpp

    r10504 r11202  
    3131{ 
    3232    public: 
    33         RenderBinPrototypeList() {} 
     33        RenderBinPrototypeList() 
     34        { 
     35            add("RenderBin",new RenderBin(RenderBin::getDefaultRenderBinSortMode())); 
     36            add("StateSortedBin",new RenderBin(RenderBin::SORT_BY_STATE)); 
     37            add("DepthSortedBin",new RenderBin(RenderBin::SORT_BACK_TO_FRONT)); 
     38            add("TraversalOrderBin",new RenderBin(RenderBin::TRAVERSAL_ORDER)); 
     39        } 
     40 
     41        void add(const std::string& name, RenderBin* bin) 
     42        { 
     43            (*this)[name] = bin; 
     44        } 
     45 
    3446        ~RenderBinPrototypeList() {} 
    3547}; 
    36  
    37 // register a RenderStage prototype with the RenderBin prototype list. 
    38 RegisterRenderBinProxy s_registerRenderBinProxy("RenderBin",new RenderBin(RenderBin::getDefaultRenderBinSortMode())); 
    39 RegisterRenderBinProxy s_registerStateSortedBinProxy("StateSortedBin",new RenderBin(RenderBin::SORT_BY_STATE)); 
    40 RegisterRenderBinProxy s_registerDepthSortedBinProxy("DepthSortedBin",new RenderBin(RenderBin::SORT_BACK_TO_FRONT)); 
    41 RegisterRenderBinProxy s_registerTraversalOrderProxy("TraversalOrderBin",new RenderBin(RenderBin::TRAVERSAL_ORDER)); 
    42  
    4348 
    4449static RenderBinPrototypeList* renderBinPrototypeList()