Changeset 13041 for OpenSceneGraph/trunk/src/osgGA/StateSetManipulator.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgGA/StateSetManipulator.cpp
r10946 r13041 39 39 _stateset = stateset; 40 40 #if 0 41 // specify that this stateset is dynamic so it prevents 42 // the draw and update phase from overlapping - good for 43 // stability but breaks all the performance advantage of 41 // specify that this stateset is dynamic so it prevents 42 // the draw and update phase from overlapping - good for 43 // stability but breaks all the performance advantage of 44 44 // DrawThreadPerContex. 45 45 _stateset->setDataVariance(osg::Object::DYNAMIC); … … 60 60 { 61 61 if (!_stateset) return; 62 62 63 63 // we clone the StateSet so that any draw traversals that might be running at the time of the 64 // event traversal won't change the same StateSet that is being read. One could just set the 64 // event traversal won't change the same StateSet that is being read. One could just set the 65 65 // DataVariance to DYNAMIC to avoid this overlap, but this would introduce a performance penalty. 66 66 67 67 StateSet::ParentList parents = _stateset->getParents(); 68 68 osg::ref_ptr<osg::StateSet> newStateSet = dynamic_cast<osg::StateSet*>(_stateset->clone(osg::CopyOp::SHALLOW_COPY)); … … 82 82 } 83 83 } 84 84 85 85 _stateset = newStateSet; 86 86 } … … 102 102 (_stateset->getTextureMode(0,GL_TEXTURE_RECTANGLE)&mode)!=0 || 103 103 (_stateset->getTextureMode(0,GL_TEXTURE_CUBE_MAP)&mode)!=0; 104 104 105 105 #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) 106 106 _texture |= ((_stateset->getTextureMode(0,GL_TEXTURE_1D)&mode)!=0); … … 154 154 { 155 155 if (_backface == newbackface) return; 156 157 clone(); 158 156 157 clone(); 158 159 159 _backface = newbackface; 160 160 if( _backface ) _stateset->setMode(GL_CULL_FACE,osg::StateAttribute::ON); … … 165 165 { 166 166 if (_lighting == newlighting) return; 167 167 168 168 clone(); 169 169 … … 176 176 { 177 177 if (_texture==newtexture) return; 178 178 179 179 clone(); 180 180 … … 214 214 215 215 osg::PolygonMode::Mode currentMode = getPolygonMode(); 216 // cycle through the available modes. 216 // cycle through the available modes. 217 217 switch(currentMode) 218 218 { … … 233 233 { 234 234 osg::PolygonMode* polyModeObj = dynamic_cast<osg::PolygonMode*>(_stateset->getAttribute(osg::StateAttribute::POLYGONMODE)); 235 if (!polyModeObj) 235 if (!polyModeObj) 236 236 { 237 237 polyModeObj = new osg::PolygonMode;
