Added debug State::print(std::ostream&) method and extra debug messages in ShaderComposer and ShaderAttribute.

Added better shader composition testing in the osgshadercomposition example.
This commit is contained in:
Robert Osfield
2010-07-10 17:14:59 +00:00
parent d45cb5f7a1
commit 64b26ebeb5
6 changed files with 257 additions and 23 deletions

View File

@@ -38,6 +38,14 @@ ShaderAttribute::~ShaderAttribute()
{
}
osg::Object* ShaderAttribute::cloneType() const
{
ShaderAttribute* sa = new ShaderAttribute;
sa->setType(getType());
OSG_NOTICE<<" cloneType ="<<getType()<<" sa = "<<sa<<std::endl;
return sa;
}
int ShaderAttribute::compare(const StateAttribute& sa) const
{
// check the types are equal and then create the rhs variable
@@ -83,6 +91,8 @@ bool ShaderAttribute::getModeUsage(StateAttribute::ModeUsage& usage) const
void ShaderAttribute::apply(State& state) const
{
OSG_INFO<<"ShaderAttribute::apply(State&) this="<<this<<" type = "<<getType()<<std::endl;
for(Uniforms::const_iterator itr = _uniforms.begin();
itr != _uniforms.end();
++itr)