more than 1 root

ghiboz

25-10-2012 12:55:15

hi all!
I need to create 2 instances of root with scene etc..
it creates, but when shutdown, the resources, etc (everything uses singleton) , will crash...
does anybody have some solution for this?

thank you very much

Tubulii

26-10-2012 21:11:36

Two instances of root (== ogre core component)? That is not possible/recommend/supported:
(M)Ogre uses Singletons (one instance in the same application context) e.g. TextureManager, MeshManager -> the second created root will "override" the first one.
Why do you want to create two root objects?

Beauty

27-10-2012 17:47:44

I'm not shure, but maybe you can create 2 scene managers.
Both of them contain one root. So you have 2 roots and 2 independent "worlds".

If you want to have 2 root nodes in one single scene, you can create 2 "helper nodes" and attach them to the real root node.
All other 3D objects you attach to the helper node of your choice.

Can you tell us some more details of your intention?

Tubulii

27-10-2012 18:04:45

Both of them contain one root. So you have 2 roots and 2 independent "worlds".
Do you mean two root class instances? One root instance with two scene managers should be "better".

Beauty

27-10-2012 18:56:53

Oh, I mixed up Root with RootSceneNode :oops: