OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MultiTextureControl.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
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
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSGFX_MULTITEXTURECONTROL
15 #define OSGFX_MULTITEXTURECONTROL
16 
17 #include <osg/Group>
18 
19 #include <osgFX/Export>
20 
21 namespace osgFX
22 {
28  public:
29 
32 
34 
36 
37  void setTextureWeights(TextureWeights* twl) { _textureWeights = twl; }
38  TextureWeights* getTextureWeights() { return _textureWeights.get(); }
39  const TextureWeights* getTextureWeights() const { return _textureWeights.get(); }
40 
41  void setTextureWeight(unsigned int unit, float weight);
42  float getTextureWeight(unsigned int unit) const { return (unit<_textureWeights->size()) ? (*_textureWeights)[unit] : 0.0f; }
43  unsigned int getNumTextureWeights() const { return _textureWeights->size(); }
44 
45  void setUseTexEnvCombine(bool flag) { _useTexEnvCombine = flag; }
46  bool getUseTexEnvCombine() const { return _useTexEnvCombine; }
47 
48  void setUseTextureWeightsUniform(bool flag) { _useTextureWeightsUniform = flag; }
49  bool getUseTextureWeightsUniform() const { return _useTextureWeightsUniform; }
50 
51  protected:
52 
53  virtual ~MultiTextureControl() {}
54  MultiTextureControl& operator = (const MultiTextureControl&) { return *this; }
55 
56  void updateStateSet();
57 
59 
62 
63  };
64 
65 }
66 
67 #endif
void setTextureWeights(TextureWeights *twl)
osg::ref_ptr< TextureWeights > _textureWeights
unsigned int getNumTextureWeights() const
#define META_Node(library, name)
Definition: Node.h:59
void setUseTextureWeightsUniform(bool flag)
float getTextureWeight(unsigned int unit) const
TextureWeights * getTextureWeights()
#define OSGFX_EXPORT
Definition: Export.h:27
bool getUseTextureWeightsUniform() const
const TextureWeights * getTextureWeights() const