Changeset 13041 for OpenSceneGraph/trunk/include/osgFX/Effect
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osgFX/Effect (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgFX/Effect
r5328 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 */ … … 51 51 often using different OpenGL extensions. The active technique can be 52 52 selected either manually, with selectTechnique(), or automatically, in which 53 case the first technique that is supported by all active rendering contexts 53 case the first technique that is supported by all active rendering contexts 54 54 is chosen. 55 If you are an Effect user, then simply use it as a node group. Create an 56 instance of your desired effect, add it to your scene graph and call its 55 If you are an Effect user, then simply use it as a node group. Create an 56 instance of your desired effect, add it to your scene graph and call its 57 57 addChild() method to add a child node as you would do with a Group. 58 58 If you are an Effect developer, you will have to implement the method … … 75 75 /** get the name of this Effect */ 76 76 virtual const char *effectName() const = 0; 77 77 78 78 /** get a brief description of this Effect*/ 79 79 virtual const char *effectDescription() const = 0; … … 87 87 /** set whether the effect is enabled or not */ 88 88 inline void setEnabled(bool v); 89 89 90 90 /** 91 91 optional: set effect parameters to produce a visually significant … … 97 97 /** get the number of techniques defined for this Effect */ 98 98 inline int getNumTechniques() const; 99 99 100 100 /** get the i-th Technique */ 101 101 inline Technique* getTechnique(int i); … … 115 115 116 116 /** custom traversal */ 117 virtual void traverse(osg::NodeVisitor& nv); 117 virtual void traverse(osg::NodeVisitor& nv); 118 118 119 119 /** default traversal */ … … 123 123 virtual ~Effect(); 124 124 Effect &operator=(const Effect &) { return *this; } 125 125 126 126 /** force rebuilding of techniques on next traversal */ 127 127 inline void dirtyTechniques(); … … 137 137 */ 138 138 virtual bool define_techniques() = 0; 139 139 140 140 private: 141 141 friend class Validator; … … 150 150 // use int instead of bool to avoid errors 151 151 mutable osg::buffered_value<int> _tech_selected; 152 152 153 153 int _global_sel_tech; 154 154 … … 156 156 157 157 osg::ref_ptr<osg::Geode> _dummy_for_validation; 158 158 159 159 void build_dummy_node(); 160 160 }; … … 171 171 _enabled = v; 172 172 } 173 173 174 174 inline int Effect::getNumTechniques() const 175 175 { … … 201 201 _techs.push_back(tech); 202 202 } 203 203 204 204 inline void Effect::dirtyTechniques() 205 205 { 206 206 _techs_defined = false; 207 207 } 208 208 209 209 inline void Effect::inherited_traverse(osg::NodeVisitor& nv) 210 210 {
