Page 1 of 1

How to share model information between views?

Posted: Fri Sep 28, 2007 9:49 am
by izhbq412
Hi everyone.
I have a pretty simple question - I want to display a single mesh in several different windows - each window has its own IrrlichtDevice, video driver, scene graph etc.

However they all need to display the same model data, which takes up quite a lot of memory. So, how can I share the model data between the scene graphs? Looking at the COctTreeSceneNode::createTree function I saw that it makes an internal copy of the vertex data in order to build the tree, so I guess I'll have to share the node itself. I'm thinking along the lines of adding the same COctTreeSceneNode instance to all the scene managers. Is that possible? I couldn't find a suitable function in ISceneManager...

Posted: Fri Sep 28, 2007 10:04 am
by JP
Do you actually require seperate windows with seperate devices? Can't you do splitscreen with one device? There's a tutorial showing you how to do that on the main webpage, it's very simple.

Posted: Fri Sep 28, 2007 10:26 am
by izhbq412
I really do need separate windows, they're different Windows windows, it's not a game running in full screen :)

Posted: Fri Sep 28, 2007 11:00 am
by TomiZ
You can use one device to render in multiple windows.
In function endScene you can specify window ID, and viewport size. But you have to create windows "manually" (with winAPI or forms).

Posted: Fri Sep 28, 2007 11:30 am
by hybrid
Yes, that's the way to go. Otherwise you cannot share data.

Posted: Sat Sep 29, 2007 5:36 am
by izhbq412
That makes sense and is a viable solution in my case. Thanks for the help :)