Added blend color to osg::TexEnv

This commit is contained in:
Robert Osfield
2002-07-12 10:30:27 +00:00
parent 0d84d3ed15
commit 3edb8a3d18
3 changed files with 45 additions and 13 deletions

View File

@@ -7,6 +7,7 @@
#include <osg/GL>
#include <osg/StateAttribute>
#include <osg/Vec4>
namespace osg {
@@ -20,7 +21,8 @@ class SG_EXPORT TexEnv : public StateAttribute
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
TexEnv(const TexEnv& texenv,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
StateAttribute(texenv,copyop),
_mode(texenv._mode) {}
_mode(texenv._mode),
_color(texenv._color) {}
META_StateAttribute(osg, TexEnv, TEXENV);
@@ -36,6 +38,7 @@ class SG_EXPORT TexEnv : public StateAttribute
// compare each paramter in turn against the rhs.
COMPARE_StateAttribute_Parameter(_mode)
COMPARE_StateAttribute_Parameter(_color)
return 0; // passed all the above comparison macro's, must be equal.
}
@@ -47,17 +50,25 @@ class SG_EXPORT TexEnv : public StateAttribute
REPLACE = GL_REPLACE
};
void setMode( const Mode mode );
void setMode( const Mode mode ) { _mode = mode; }
const Mode getMode() const { return _mode; }
void setColor( const Vec4& color ) { _color = color; }
Vec4& getColor() { return _color; }
const Vec4& getColor() const { return _color; }
virtual void apply(State& state) const;
protected :
virtual ~TexEnv( void );
Mode _mode;
Mode _mode;
osg::Vec4 _color;
};
}