Integrated Geoff Michel's updates to Stats code, whilest move all text rendering

back in the viewer from the Statistics header.

Added a osg::State::captureCurrentState(StateSet&) method and a copy constructor
to osg::StateSet.
This commit is contained in:
Robert Osfield
2001-10-22 22:02:47 +00:00
parent aac507e119
commit 25c8b05914
16 changed files with 453 additions and 345 deletions

View File

@@ -161,6 +161,36 @@ void State::popStateSet()
_drawStateStack.pop_back();
}
void State::captureCurrentState(StateSet& stateset) const
{
// empty the stateset first.
stateset.setAllToInherit();
for(ModeMap::const_iterator mitr=_modeMap.begin();
mitr!=_modeMap.end();
++mitr)
{
// note GLMode = mitr->first
const ModeStack& ms = mitr->second;
if (!ms.valueVec.empty())
{
stateset.setMode(mitr->first,ms.valueVec.back());
}
}
for(AttributeMap::const_iterator aitr=_attributeMap.begin();
aitr!=_attributeMap.end();
++aitr)
{
const AttributeStack& as = aitr->second;
if (!as.attributeVec.empty())
{
stateset.setAttribute(const_cast<StateAttribute*>(as.attributeVec.back().first));
}
}
}
void State::apply(const StateSet* dstate)
{
// equivilant to: