Changeset 13041 for OpenSceneGraph/trunk/include/osgUtil/GLObjectsVisitor
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgUtil/GLObjectsVisitor
r9917 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 WARRANTY; 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 */ … … 24 24 namespace osgUtil { 25 25 26 /** Visitor for traversing scene graph and setting each osg::Drawable's _useDisplayList flag, 26 /** Visitor for traversing scene graph and setting each osg::Drawable's _useDisplayList flag, 27 27 * with option to immediately compile osg::Drawable OpenGL Display lists and 28 28 * osg::StateAttribute's. … … 45 45 CHECK_BLACK_LISTED_MODES = 0x100 46 46 }; 47 47 48 48 typedef unsigned int Mode; 49 49 50 50 /** Construct a GLObjectsVisitor to traverse all children, operating on 51 * node according to specified mode, such as to compile or release 52 * display list/texture objects etc. Default mode is to compile 51 * node according to specified mode, such as to compile or release 52 * display list/texture objects etc. Default mode is to compile 53 53 * GL objects. 54 54 */ 55 GLObjectsVisitor(Mode mode=COMPILE_DISPLAY_LISTS|COMPILE_STATE_ATTRIBUTES|CHECK_BLACK_LISTED_MODES); 56 55 GLObjectsVisitor(Mode mode=COMPILE_DISPLAY_LISTS|COMPILE_STATE_ATTRIBUTES|CHECK_BLACK_LISTED_MODES); 56 57 57 META_NodeVisitor("osg","GLObjectsVisitor") 58 58 59 59 virtual void reset() 60 60 { … … 63 63 } 64 64 65 65 66 66 /** Set the operational mode of what operations to do on the scene graph.*/ 67 67 void setMode(Mode mode) { _mode = mode; } … … 69 69 /** Get the operational mode.*/ 70 70 Mode getMode() const { return _mode; } 71 71 72 72 73 73 /** Set the State to use during traversal. */ … … 76 76 _renderInfo.setState(state); 77 77 } 78 78 79 79 osg::State* getState() 80 80 { … … 86 86 _renderInfo = renderInfo; 87 87 } 88 88 89 89 osg::RenderInfo& getRenderInfo() 90 90 { … … 94 94 /** Simply traverse using standard NodeVisitor traverse method.*/ 95 95 virtual void apply(osg::Node& node); 96 97 /** For each Geode visited set the display list usage according to the 96 97 /** For each Geode visited set the display list usage according to the 98 98 * _displayListMode. 99 99 */ … … 125 125 126 126 virtual void operator () (osg::GraphicsContext* context); 127 127 128 128 protected: 129 129 130 130 osg::ref_ptr<osg::Node> _subgraph; 131 131 GLObjectsVisitor::Mode _mode;
