2002-08-28 23:44:03 +08:00
|
|
|
#include <osg/GLExtensions>
|
2002-06-18 18:18:12 +08:00
|
|
|
#include <osg/ColorMatrix>
|
2001-12-19 08:38:23 +08:00
|
|
|
#include <osg/GL>
|
|
|
|
|
|
|
|
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
|
|
|
}
|