simed
19-10-2011 14:14:32
I noticed that when using Canvas with RenderTexture, it is still rendered to when the Canvas is not visible. And, I can't see any event which will notify me when a widget is shown/hidden. So if I construct a kind of dialog with a Canvas object as a control, I have to write bespoke logic to make sure I disable any/all Canvas controls:
In fact looking at MyGUI_Canvas.cpp I cannot see where the texture gets updated at all, or even how Canvas gets rendered. Can anyone help me understand how it is connected together, and advise how I might implement the functionality?
Ogre::TexturePtr texture = static_cast<MyGUI::OgreTexture*>(
m_canvas->getTexture())->getOgreTexture();
Ogre::RenderTexture* target = texture->getBuffer()->getRenderTarget();
terget->setActive(false);
Since MyGUI is not Ogre-specific, I'm not even sure how I could modify the MyGUI source to prevent rendering when hidden... ideally a flag which can toggle this new behavior.In fact looking at MyGUI_Canvas.cpp I cannot see where the texture gets updated at all, or even how Canvas gets rendered. Can anyone help me understand how it is connected together, and advise how I might implement the functionality?