How to share model information between views?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
izhbq412
Posts: 11
Joined: Fri Sep 28, 2007 9:31 am

How to share model information between views?

Post 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...
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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.
Image Image Image
izhbq412
Posts: 11
Joined: Fri Sep 28, 2007 9:31 am

Post by izhbq412 »

I really do need separate windows, they're different Windows windows, it's not a game running in full screen :)
TomiZ
Posts: 40
Joined: Wed Aug 29, 2007 6:02 am
Location: Poland
Contact:

Post 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).
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, that's the way to go. Otherwise you cannot share data.
izhbq412
Posts: 11
Joined: Fri Sep 28, 2007 9:31 am

Post by izhbq412 »

That makes sense and is a viable solution in my case. Thanks for the help :)
Post Reply