Changeset 13041 for OpenSceneGraph/trunk/src/osg/View.cpp
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osg/View.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osg/View.cpp
r12195 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRA;NTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 36 36 37 37 _camera->setClearColor(osg::Vec4f(0.2f, 0.2f, 0.4f, 1.0f)); 38 38 39 39 osg::StateSet* stateset = _camera->getOrCreateStateSet(); 40 40 stateset->setGlobalDefaults(); … … 60 60 _camera->setCullCallback(0); 61 61 } 62 62 63 63 // detach the cameras from this View to prevent dangling pointers 64 64 for(Slaves::iterator itr = _slaves.begin(); … … 70 70 cd._camera->setCullCallback(0); 71 71 } 72 72 73 73 _camera = 0; 74 74 _slaves.clear(); 75 _light = 0; 75 _light = 0; 76 76 77 77 #if 0 … … 82 82 } 83 83 #endif 84 84 85 85 OSG_INFO<<"Done destructing osg::View"<<std::endl; 86 86 } … … 94 94 _slaves = rhs._slaves; 95 95 96 // update the cameras so they all now see this View as their parent View 96 // update the cameras so they all now see this View as their parent View 97 97 if (_camera.valid()) _camera->setView(this); 98 98 99 99 for(unsigned int i=0; i<_slaves.size(); ++i) 100 100 { … … 112 112 { 113 113 _lightingMode = lightingMode; 114 if (_lightingMode != NO_LIGHT && !_light) 114 if (_lightingMode != NO_LIGHT && !_light) 115 115 { 116 116 _light = new osg::Light; … … 127 127 { 128 128 if (_camera.valid()) _camera->setView(0); 129 129 130 130 _camera = camera; 131 131 … … 170 170 { 171 171 camera->removeChildren(0,camera->getNumChildren()); 172 172 173 173 if (_camera.valid()) 174 174 { … … 183 183 184 184 _slaves[i].updateSlave(*this); 185 186 camera->setRenderer(createRenderer(camera)); 185 186 camera->setRenderer(createRenderer(camera)); 187 187 188 188 return true; … … 195 195 _slaves[pos]._camera->setView(0); 196 196 _slaves[pos]._camera->setCullCallback(0); 197 197 198 198 _slaves.erase(_slaves.begin()+pos); 199 199 … … 219 219 if (_slaves[i]._camera == camera) return (i); 220 220 } 221 221 222 222 return _slaves.size(); 223 223 }
