Abstract Base Class for every Scene. Users inherit from this class and override on_load() and optionally on_unload() in order to create their entites, registers systems, and subscribe to events.
More...
#include <Imago/Engine/Scene.hpp>
|
| | Scene (const SceneContext &gameCtx) |
| | Construct a new Scene object and copies the game's persistent context and fills the remaining pointers with this scene's instance of the Nexus and Broadcaster.
|
|
| Scene (const Scene &)=delete |
|
Scene & | operator= (const Scene &)=delete |
|
| Scene (Scene &&)=delete |
|
Scene & | operator= (Scene &&)=delete |
|
void | load () |
| | Loads the scene. Runs the user-defined on_load() method then flushes everything so they actually go through before the first frame of execution.
|
|
void | unload () |
| | Unloads the scene. Runs the user-defined on_unload() method then flushes everything.
|
| void | update (float dt) |
| | Runs one frame by ticking the scheduler, then flushes the Nexus.
|
|
|
virtual void | on_load ()=0 |
| | Called by load(). Behavior is defined in user definitions of Scenes were the user can create entities, register systems, and subscribe to events.
|
|
virtual void | on_unload () |
| | Called by unload(). This is optional in user definitions of Scenes because most clean-up is handled automatically but any additional clean up that ought to happen during the termination of a Scene should go here.
|
Abstract Base Class for every Scene. Users inherit from this class and override on_load() and optionally on_unload() in order to create their entites, registers systems, and subscribe to events.
A Scene owns everything that its systems run against. It owns its own copy of the SceneContext with nexus and broadcaster pointing at its own members so the Scene must stay self-consistent for its whole life.
◆ Scene()
Construct a new Scene object and copies the game's persistent context and fills the remaining pointers with this scene's instance of the Nexus and Broadcaster.
- Parameters
-
◆ update()
| void Imago::Engine::Scene::update |
( |
float | dt | ) |
|
Runs one frame by ticking the scheduler, then flushes the Nexus.
- Parameters
-
| dt | Real time since the last frame, in seconds. |
The documentation for this class was generated from the following files:
- engine/include/Imago/Engine/Scene.hpp
- engine/src/Engine/Scene.cpp