Added a bunch of files synched with 0.8.42
This commit is contained in:
@@ -1,37 +1,56 @@
|
||||
#include "osgUtil/DisplayListVisitor"
|
||||
#include "osg/GeoSet"
|
||||
#include "osg/Drawable"
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgUtil;
|
||||
|
||||
DisplayListVisitor::DisplayListVisitor(DisplayListMode mode)
|
||||
{
|
||||
setTraverseMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN);
|
||||
setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN);
|
||||
_displayListMode = mode;
|
||||
|
||||
_localState = new osg::State;
|
||||
_externalState = NULL;
|
||||
|
||||
_activeState = _localState;
|
||||
}
|
||||
|
||||
|
||||
void DisplayListVisitor::apply(osg::Geode& node)
|
||||
{
|
||||
switch(_displayListMode)
|
||||
{
|
||||
case(SWITCH_OFF_DISPLAY_LISTS):
|
||||
case(SWITCH_OFF_DISPLAY_LISTS):
|
||||
{
|
||||
for(int i=0;i<node.getNumGeosets();++i)
|
||||
for(int i=0;i<node.getNumDrawables();++i)
|
||||
{
|
||||
node.getGeoSet(i)->setUseDisplayList(false);
|
||||
node.getDrawable(i)->setUseDisplayList(false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case(SWITCH_ON_DISPLAY_LISTS):
|
||||
case(SWITCH_ON_DISPLAY_LISTS):
|
||||
{
|
||||
for(int i=0;i<node.getNumGeosets();++i)
|
||||
for(int i=0;i<node.getNumDrawables();++i)
|
||||
{
|
||||
node.getGeoSet(i)->setUseDisplayList(true);
|
||||
node.getDrawable(i)->setUseDisplayList(true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case(SWITCH_ON_AND_COMPILE_DISPLAY_LISTS):
|
||||
node.compileGeoSets();
|
||||
case(COMPILE_ON_DISPLAY_LISTS):
|
||||
{
|
||||
for(int i=0;i<node.getNumDrawables();++i)
|
||||
{
|
||||
if (node.getDrawable(i)->getUseDisplayList())
|
||||
{
|
||||
node.getDrawable(i)->compile(*_activeState);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case(SWITCH_ON_AND_COMPILE_DISPLAY_LISTS):
|
||||
{
|
||||
node.compileDrawables(*_activeState);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user