Added a bunch of files synched with 0.8.42

This commit is contained in:
Don BURNS
2001-09-19 21:08:56 +00:00
parent fed86f3f03
commit e8f256a59d
446 changed files with 58397 additions and 10552 deletions

View File

@@ -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;
}
}