Thanks Mourad, 

That solves my problem. I saw this method used inside the code but did not 
notice it is static so I thought it can be used only when we know the uniform 
ptr. 

Do you think it makes sense to add following extra method to PerContextProgram ?

inline GLint  getUniformLocation( const std::string & name )
{ 
    return getUniformLocation( osg::Uniform::getNameId(  name ) );
}

Cheers,
Wojtek 


From: Mourad Boufarguine 
Sent: Wednesday, December 08, 2010 12:47 PM
To: OpenSceneGraph Users 
Subject: Re: [osg-users] osgCal does not build - where is 
PerContextProgram::getUniformLocation( string ) method ?

Hi Wojciech, 

This change was introduced in rev 11952. This new static function in 
osg/Uniform should help you to get the (unsigned int) id out of the (string) 
name :


static unsigned int getNameID(const std::string& name);

Mourad



2010/12/8 Wojciech Lewandowski <[email protected]>

  Hi Guys,

  The title says it all. We use osgCal and it does not compile anymore. 
Compiler  does not find Program::PerContextProgram::getUniformLocation( const 
std::string & ) while compiling HardwareMesh.cpp. Problem appeared with trunk 
change revision 11942: 

  Where  
      Program::PerContextProgram::getUniformLocation( const std::string & ) 
  was replaced with:
      Program:: PerContextProgram::getUniformLocation( unsigned int )

  I tried to look at modified PerContextProgram to figure out how to get 
uniform location knowing only uniform name but I was not able to come up with 
reasonable idea. Can anyone help me ?

  Ideally we could possible retrofit PerProgramContext with a method that would 
accept  string name ? It does not mean reverting all the code that was changed 
recently I would only want to have another version of 
PerContextProgram::getUniformLocation( int ) with string parameter so that 
osgCall still compile.

  Cheers,
  Wojtek Lewandowski

  _______________________________________________
  osg-users mailing list
  [email protected]
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





--------------------------------------------------------------------------------
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to