Added support for set/getUniform and set/getProgram into osg::StateSet.

This commit is contained in:
Robert Osfield
2005-03-11 20:29:21 +00:00
parent 3005f34cc4
commit a2e8bc6267
13 changed files with 1635 additions and 248 deletions

View File

@@ -424,32 +424,12 @@ Uniform::Uniform( const char* name, int i ) :
Uniform::Uniform( const Uniform& gu, const CopyOp& copyop ) :
StateAttribute(gu,copyop),
Object(gu,copyop),
_value( gu._value )
{
}
void Uniform::apply( State& /*state*/ ) const
{
// The definition of apply() for Uniforms is unique among
// osg::StateAttributes...
// If a Program is not active, then cannot apply the uniform value,
// but must wait for a Program to do that itself later when it
// does become active.
// If a Program is active, then the Uniform may be applied
// immediately.
// something like...
//
// Program* program = state->getActiveProgram();
// if( program )
// {
// program->applyUniform( this );
// }
}
bool Uniform::set( float f )
{
if( ! isCompatibleType( Value::FLOAT ) ) return false;