From 11b8bd1fd9aab23f4cfdf7308b3915552678aa5c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 22 May 2002 10:04:28 +0000 Subject: [PATCH] Changed the public osg::State::applyMode() and applyAttribute methods so that they dirty the associated state, this helps keep the OpenGL state valid once out of local drawing routines. --- include/osg/State | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/osg/State b/include/osg/State index 8154caec9..673abd027 100644 --- a/include/osg/State +++ b/include/osg/State @@ -114,14 +114,18 @@ class SG_EXPORT State : public Referenced /** Apply an OpenGL mode if required. */ inline const bool applyMode(const StateAttribute::GLMode mode,const bool enabled) { - return applyMode(mode,enabled,_modeMap[mode]); + ModeStack& ms = _modeMap[mode]; + ms.changed = true; + return applyMode(mode,enabled,ms); } /** Apply an attribute if required. */ inline const bool applyAttribute(const StateAttribute* attribute) { - return applyAttribute(attribute,_attributeMap[attribute->getType()]); + AttributeStack& as = _attributeMap[attribute->getType()]; + as.changed = true; + return applyAttribute(attribute,as); }