Changeset 3252
- Timestamp:
- 08/07/04 11:42:19 (9 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 2 modified
-
include/osg/State (modified) (5 diffs)
-
src/osgUtil/RenderStageLighting.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/State
r2259 r3252 154 154 155 155 156 inline void setGlobalDefaultModeValue(StateAttribute::GLMode mode,bool enabled) 157 { 158 ModeStack& ms = _modeMap[mode]; 159 ms.global_default_value = enabled; 160 } 161 162 inline bool getGlobalDefaultModeValue(StateAttribute::GLMode mode) 163 { 164 return _modeMap[mode].global_default_value; 165 } 166 167 156 168 /** Apply an OpenGL mode if required. */ 157 169 inline bool applyMode(StateAttribute::GLMode mode,bool enabled) … … 160 172 ms.changed = true; 161 173 return applyMode(mode,enabled,ms); 174 } 175 176 inline void setGlobalDefaultTextureModeValue(unsigned int unit, StateAttribute::GLMode mode,bool enabled) 177 { 178 ModeMap& modeMap = getOrCreateTextureModeMap(unit); 179 ModeStack& ms = modeMap[mode]; 180 ms.global_default_value = enabled; 181 } 182 183 inline bool getGlobalDefaultTextureModeValue(unsigned int unit, StateAttribute::GLMode mode) 184 { 185 ModeMap& modeMap = getOrCreateTextureModeMap(unit); 186 ModeStack& ms = modeMap[mode]; 187 return ms.global_default_value; 162 188 } 163 189 … … 175 201 } 176 202 203 inline void setGlobalDefaultAttribute(const StateAttribute* attribute) 204 { 205 AttributeStack& as = _attributeMap[attribute->getType()]; 206 as.global_default_attribute = attribute; 207 } 208 209 inline const StateAttribute* getGlobalDefaultAttribute(StateAttribute::Type type) 210 { 211 AttributeStack& as = _attributeMap[type]; 212 return as.global_default_attribute.get(); 213 } 214 177 215 /** Apply an attribute if required. */ 178 216 inline bool applyAttribute(const StateAttribute* attribute) … … 182 220 return applyAttribute(attribute,as); 183 221 } 222 223 inline void setGlobalDefaultTextureAttribute(unsigned int unit, const StateAttribute* attribute) 224 { 225 AttributeMap& attributeMap = getOrCreateTextureAttributeMap(unit); 226 AttributeStack& as = attributeMap[attribute->getType()]; 227 as.global_default_attribute = attribute; 228 } 229 230 inline const StateAttribute* getGlobalDefaultTextureAttribute(unsigned int unit, StateAttribute::Type type) 231 { 232 AttributeMap& attributeMap = getOrCreateTextureAttributeMap(unit); 233 AttributeStack& as = attributeMap[type]; 234 return as.global_default_attribute.get(); 235 } 236 184 237 185 238 inline bool applyTextureAttribute(unsigned int unit, const StateAttribute* attribute) … … 677 730 bool changed; 678 731 const StateAttribute* last_applied_attribute; 679 ref_ptr< StateAttribute> global_default_attribute;732 ref_ptr<const StateAttribute> global_default_attribute; 680 733 AttributeVec attributeVec; 681 734 }; -
OpenSceneGraph/trunk/src/osgUtil/RenderStageLighting.cpp
r3125 r3252 54 54 // tell state about. 55 55 state.haveAppliedAttribute(litr->first.get()); 56 56 57 // set this state as a global default 58 state.setGlobalDefaultAttribute(litr->first.get()); 57 59 } 58 60 … … 77 79 state.haveAppliedTextureAttribute(titr->first, litr->first.get()); 78 80 81 // set this state as a global default 82 state.setGlobalDefaultTextureAttribute(titr->first, litr->first.get()); 79 83 } 80 84
