Added osg::State::dirtyAllModes() and dirtyAllAttributes() methods.
This commit is contained in:
@@ -223,6 +223,12 @@ class SG_EXPORT State : public Referenced
|
||||
const StateAttribute* getLastAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type) const;
|
||||
|
||||
|
||||
/** Dirty the modes previously applied in osg::State.*/
|
||||
void dirtyAllModes();
|
||||
|
||||
/** Dirty the modes attributes previously applied in osg::State.*/
|
||||
void dirtyAllAttributes();
|
||||
|
||||
/** disable the vertex, normal, color, tex coords, secenday color, fog coord and index arrays.*/
|
||||
void disableAllVertexArrays();
|
||||
|
||||
|
||||
@@ -397,6 +397,64 @@ const StateAttribute* State::getLastAppliedAttribute(const AttributeMap& attribu
|
||||
}
|
||||
}
|
||||
|
||||
void State::dirtyAllModes()
|
||||
{
|
||||
for(ModeMap::iterator mitr=_modeMap.begin();
|
||||
mitr!=_modeMap.end();
|
||||
++mitr)
|
||||
{
|
||||
ModeStack& ms = mitr->second;
|
||||
ms.last_applied_value = !ms.last_applied_value;
|
||||
ms.changed = true;
|
||||
|
||||
}
|
||||
|
||||
for(TextureModeMapList::iterator tmmItr=_textureModeMapList.begin();
|
||||
tmmItr!=_textureModeMapList.end();
|
||||
++tmmItr)
|
||||
{
|
||||
for(ModeMap::iterator mitr=tmmItr->begin();
|
||||
mitr!=tmmItr->end();
|
||||
++mitr)
|
||||
{
|
||||
ModeStack& ms = mitr->second;
|
||||
ms.last_applied_value = !ms.last_applied_value;
|
||||
ms.changed = true;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void State::dirtyAllAttributes()
|
||||
{
|
||||
for(AttributeMap::iterator aitr=_attributeMap.begin();
|
||||
aitr!=_attributeMap.end();
|
||||
++aitr)
|
||||
{
|
||||
AttributeStack& as = aitr->second;
|
||||
as.last_applied_attribute = 0;
|
||||
as.changed = true;
|
||||
}
|
||||
|
||||
|
||||
for(TextureAttributeMapList::iterator tamItr=_textureAttributeMapList.begin();
|
||||
tamItr!=_textureAttributeMapList.end();
|
||||
++tamItr)
|
||||
{
|
||||
AttributeMap& attributeMap = *tamItr;
|
||||
for(AttributeMap::iterator aitr=attributeMap.begin();
|
||||
aitr!=attributeMap.end();
|
||||
++aitr)
|
||||
{
|
||||
AttributeStack& as = aitr->second;
|
||||
as.last_applied_attribute = 0;
|
||||
as.changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Polytope State::getViewFrustum() const
|
||||
{
|
||||
Polytope cv;
|
||||
@@ -405,6 +463,8 @@ Polytope State::getViewFrustum() const
|
||||
return cv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void State::disableAllVertexArrays()
|
||||
{
|
||||
disableVertexPointer();
|
||||
|
||||
Reference in New Issue
Block a user