Page 1 of 1

SimpleRenderables setmaterial

Posted: Mon Oct 10, 2011 5:35 am
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.