Games with more than one level

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
DreiDe
Posts: 6
Joined: Wed Mar 31, 2004 7:45 am
Location: Germany

Games with more than one level

Post by DreiDe »

How is the correct and safe way in Irrlicht for switching in a game from the first to the second level. In each Level all nodes in the scene (and perhaps the scenemanager) should newly be built.
pScenemanager->clear() ?
delete pSceneManager ?
Or have all nodes to be dropped?

Has anyone some experiences on this issue?
Is there an tutorial or demo showing this?
schick
Posts: 230
Joined: Tue Oct 07, 2003 3:55 pm
Location: Germany
Contact:

Post by schick »

Well, drop all scenenodes that do grab the level scenenode. Then drop the level itself and create all needed scenenodes and attach them to the level scenenode again

functions you may need:

Code: Select all

 virtual void irr::scene::ISceneNode::remove ()   	 [inline, virtual]
  	

Removes this scene node from the scene, deleting it.

virtual void irr::scene::ISceneNode::removeAll 	()  	[inline, virtual]
  	

Removes all children of this scene node.

virtual void irr::scene::ISceneNode::removeAnimator 	(ISceneNodeAnimator *  	  animator )  	[inline, virtual]
  	

Removes an animator from this scene node.

virtual void irr::scene::ISceneNode::removeAnimators 	()  	[inline, virtual]
  	

Removes all animators from this scene node. 
Please send me an e-mail instead of a private message.
DreiDe
Posts: 6
Joined: Wed Mar 31, 2004 7:45 am
Location: Germany

Post by DreiDe »

I think in the destructor of the SceneManager (class CSceneManager, the implementation of the interface class ISceneManager) this work is done.
I will try it this way.
schick
Posts: 230
Joined: Tue Oct 07, 2003 3:55 pm
Location: Germany
Contact:

Post by schick »

Up to you, anyway :-)
Please send me an e-mail instead of a private message.
DreiDe
Posts: 6
Joined: Wed Mar 31, 2004 7:45 am
Location: Germany

Post by DreiDe »

Simply call the clear() method of the SceneManager.
The destructor of the SceneManager or the drop() method of the SceneManager must not be called
Post Reply