How do I effeciently manage different scenes in a game? What I mean is, how do I switch between, say, a menu screen and different levels of a game?
On a side note, what 3d model format would you recommend for animation? I was thinking .X. Am I right?
Game Structure
If your scene management is strayforward (like intro->menu->game->credits) then you can write code directly.
1. create intro objects ....destroy intro objects
2. create menu object ...let user make his choices ...destroy menu objects
3. ...and so on ...
If however your scene management is dynamic (user is allowed to switch between scenes on run time) you need some kind of scene manager (your own, not Irrlicht build) to handle scenes. It should be some class probably.
Simple manager like that would for example:
If M key clicked ...clear all objects ...then load menu scene
If some other key clicked ...save one scene, clear it, then load another scene
... and so on ...
As for 3D format ...x is something like native Irrlicht format so it should be best. However I saw some posts which complain that there are some bugs in Irrlicht 1.3 related to x.
1. create intro objects ....destroy intro objects
2. create menu object ...let user make his choices ...destroy menu objects
3. ...and so on ...
If however your scene management is dynamic (user is allowed to switch between scenes on run time) you need some kind of scene manager (your own, not Irrlicht build) to handle scenes. It should be some class probably.
Simple manager like that would for example:
If M key clicked ...clear all objects ...then load menu scene
If some other key clicked ...save one scene, clear it, then load another scene
... and so on ...
As for 3D format ...x is something like native Irrlicht format so it should be best. However I saw some posts which complain that there are some bugs in Irrlicht 1.3 related to x.
I handle scene switching by assigning an empty scene node to each scene, acting as the parent for all scene nodes part of that scene. Same for gui elements. Just hide the scene's root node when it gets inactive (ie. another scene is activated) and show it when it gets activated. I recommend you create all scenes are initialization time, and destroy them when the program is about to exit.