SimpleRenderables setmaterial

Minor issues with the Ogre API that can be trivial to fix
Post Reply
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

SimpleRenderables setmaterial

Post by mkultra333 »

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.
Post Reply