SimpleRenderables setmaterial

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

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.
0 x
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.

Return to “Papercuts”

Who is online

Users browsing this forum: No registered users and 1 guest