Clean up of initialization of statics/use of getenv

This commit is contained in:
Robert Osfield
2010-03-11 16:46:01 +00:00
parent 9ab856323d
commit 6c07be375c
4 changed files with 13 additions and 39 deletions

View File

@@ -169,26 +169,6 @@ class OSGUTIL_EXPORT RenderBin : public osg::Object
};
/** Proxy class for automatic registration of renderbins with the RenderBin prototypelist.*/
class RegisterRenderBinProxy
{
public:
RegisterRenderBinProxy(const std::string& binName,RenderBin* proto)
{
_rb = proto;
RenderBin::addRenderBinPrototype(binName,_rb.get());
}
~RegisterRenderBinProxy()
{
RenderBin::removeRenderBinPrototype(_rb.get());
}
protected:
osg::ref_ptr<RenderBin> _rb;
};
}
#endif

View File

@@ -607,6 +607,3 @@ void DisplaySettings::readCommandLine(ArgumentParser& arguments)
while (arguments.read("--gl-profile-mask", _glContextProfileMask)) {}
}

View File

@@ -535,14 +535,6 @@ unsigned int Geometry::getPrimitiveSetIndex(const PrimitiveSet* primitiveset) co
bool Geometry::computeFastPathsUsed()
{
static bool s_DisableFastPathInDisplayLists = getenv("OSG_DISABLE_FAST_PATH_IN_DISPLAY_LISTS")!=0;
if (_useDisplayList && s_DisableFastPathInDisplayLists)
{
osg::notify(osg::DEBUG_INFO)<<"Geometry::computeFastPathsUsed() - Disabling fast paths in display lists"<<std::endl;
_supportsVertexBufferObjects = _fastPath = false;
return _fastPath;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// check to see if fast path can be used.

View File

@@ -30,17 +30,22 @@ class RenderBinPrototypeList : osg::depends_on<OpenThreads::Mutex*, osg::Referen
public osg::Referenced, public std::map< std::string, osg::ref_ptr<RenderBin> >
{
public:
RenderBinPrototypeList() {}
RenderBinPrototypeList()
{
add("RenderBin",new RenderBin(RenderBin::getDefaultRenderBinSortMode()));
add("StateSortedBin",new RenderBin(RenderBin::SORT_BY_STATE));
add("DepthSortedBin",new RenderBin(RenderBin::SORT_BACK_TO_FRONT));
add("TraversalOrderBin",new RenderBin(RenderBin::TRAVERSAL_ORDER));
}
void add(const std::string& name, RenderBin* bin)
{
(*this)[name] = bin;
}
~RenderBinPrototypeList() {}
};
// register a RenderStage prototype with the RenderBin prototype list.
RegisterRenderBinProxy s_registerRenderBinProxy("RenderBin",new RenderBin(RenderBin::getDefaultRenderBinSortMode()));
RegisterRenderBinProxy s_registerStateSortedBinProxy("StateSortedBin",new RenderBin(RenderBin::SORT_BY_STATE));
RegisterRenderBinProxy s_registerDepthSortedBinProxy("DepthSortedBin",new RenderBin(RenderBin::SORT_BACK_TO_FRONT));
RegisterRenderBinProxy s_registerTraversalOrderProxy("TraversalOrderBin",new RenderBin(RenderBin::TRAVERSAL_ORDER));
static RenderBinPrototypeList* renderBinPrototypeList()
{
static osg::ref_ptr<RenderBinPrototypeList> s_renderBinPrototypeList = new RenderBinPrototypeList;