2001-12-19 08:38:23 +08:00
|
|
|
#include <osg/GL>
|
2001-12-19 16:49:10 +08:00
|
|
|
#include <osg/GLExtensions>
|
2001-12-19 08:38:23 +08:00
|
|
|
#include <osg/ColorMatrix>
|
|
|
|
|
|
|
|
using namespace osg;
|
|
|
|
|
|
|
|
ColorMatrix::ColorMatrix()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ColorMatrix::~ColorMatrix()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void ColorMatrix::apply(State&) const
|
|
|
|
{
|
|
|
|
// std::cout<<"applying matrix"<<_matrix<<std::endl;
|
2001-12-19 16:49:10 +08:00
|
|
|
static bool s_ARB_imaging = isGLExtensionSupported("GL_ARB_imaging");
|
2001-12-19 23:20:29 +08:00
|
|
|
if (s_ARB_imaging)
|
|
|
|
{
|
|
|
|
glMatrixMode( GL_COLOR );
|
|
|
|
glLoadMatrixf( _matrix.ptr() );
|
|
|
|
glMatrixMode( GL_MODELVIEW );
|
|
|
|
}
|
2001-12-19 08:38:23 +08:00
|
|
|
}
|