Game Scenes

Learn how to add several scenes to the engine editor

Add Scenes

The Engine Editor can manage several Game Scenes at the same time. This feature is pretty useful when you have several game ideas, and you want to prototype all of them within the same project.

#include <Nero/engine/DevEngine.h>
#include <Nero/scene/Scene.h>
class Scene_01 : public nero::Scene
        Scene_01(nero::Scene::Context context):nero::Scene(context){};
class Scene_02 : public nero::Scene
        Scene_02(nero::Scene::Context context):nero::Scene(context){};
class Scene_03 : public nero::Scene
        Scene_03(nero::Scene::Context context):nero::Scene(context){};
int main()
    nero::DevEngine engine(1305);
        engine.addScene<Scene_01>("Scene 01");
        engine.addScene<Scene_02>("Scene 02");
        engine.addScene<Scene_03>("Scene 03");;
    return 0;

Select a Scene

When a Scene is added to the DevEngine, you can later select it using the Scene drop-down list on the right of the Editor. At any time you have one Scene selected. If you work with several Scenes, always make sure you have the right one selected.

Each Scene is managed independently from the others. When you switch from one Scene to another, the Editor will save everything in the Scene you are leaving before to load the other Scene. So don’t worry if you forgot to save one of your Scenes.

  • Shortcut : you can use the keyboard keys Page-Up and Page-Down to cycle through all your Scenes quickly.

The Default Scene

In the Scene drop-down list, you can see a Scene called “## + default + ##“. The Default Scene is added automatically by the Editor. It’s a dummy Scene, its only job is to exist. In the tutorial Launch the Editor, you can see that it’s possible to launch the Editor without adding any Scene. While this is allowed through your code, the Editor still expects at least one Scene to be available,  so the easy solution is to always create a default one.