SimpleRenderables setmaterial

Minor issues with the Ogre API that can be trivial to fix

SimpleRenderables setmaterial

Postby mkultra333 » Mon Oct 10, 2011 5:35 am

Unlike entities, you can't call setMaterial on a simple renderable using a MaterialPtr, you have to give a string name. I just found this out when trying to apply a new material to a full screen quad.

Not huge I admit, instead of
Code: Select all
miniScreen_DfShMaster->setMaterial( m_pProjectorMaterial_Fast[nProjector] ) ;

I need to go something like
Code: Select all
miniScreen_DfShMaster->setMaterial( m_pProjectorMaterial_Fast[nProjector].get()->getName() ) ;


Since I was following the same pattern I was using to set materials on my world geometry and my entities, it would have been a little nicer if I could use a MaterialPtr.
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
User avatar
mkultra333
Beholder
 
Posts: 1544
Kudos: 64
Joined: 08 Mar 2009

Return to Papercuts

Who is online

Users browsing this forum: No registered users and 1 guest