2001-10-22 05:27:40 +08:00
|
|
|
#include <osg/TexEnv>
|
2001-01-11 00:32:10 +08:00
|
|
|
|
|
|
|
using namespace osg;
|
|
|
|
|
2001-09-20 05:08:56 +08:00
|
|
|
TexEnv::TexEnv()
|
2001-01-11 00:32:10 +08:00
|
|
|
{
|
|
|
|
_mode = MODULATE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-09-20 05:08:56 +08:00
|
|
|
TexEnv::~TexEnv()
|
2001-01-11 00:32:10 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-09-20 05:08:56 +08:00
|
|
|
void TexEnv::setMode( const Mode mode )
|
2001-01-11 00:32:10 +08:00
|
|
|
{
|
|
|
|
_mode = (mode == DECAL ||
|
2001-09-20 05:08:56 +08:00
|
|
|
mode == MODULATE ||
|
|
|
|
mode == BLEND ||
|
|
|
|
mode == REPLACE ) ?
|
|
|
|
mode : MODULATE;
|
2001-01-11 00:32:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-09-20 05:08:56 +08:00
|
|
|
void TexEnv::apply(State&) const
|
2001-01-11 00:32:10 +08:00
|
|
|
{
|
2001-09-20 05:08:56 +08:00
|
|
|
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, _mode);
|
2001-01-11 00:32:10 +08:00
|
|
|
}
|