Using the same Ogre in two Forms


16-03-2006 20:45:13


I need use a Ogre windows embedded in a WinForm Panel. It isn't a problem with:

myRenderWindow = myRoot.Initialise(panel1);

But In the application I need to close one Form and open another one that also have a ogre window. I could shutdown ogre and reinitialise all platform but it will be too heavy. For that reason, I'm trying "move" the panel from the form1 to form2, but I don't know how do it.

Anybody can help me :(


17-03-2006 01:19:25

i often copy controls from one form to another:

secondForm.Controls.Add( firstForm.Controls["mNameOfControl"] );


i know this works to copy controls over, but im not 100% sure what will happen if that control happens to be the Panel your rendering OGRE to. try it out and let us know...


17-03-2006 07:13:30

I'd add to this, to be sure the first container form, or the panel itself, is not disposed.