|
| | SceneManager () |
| | Constructor for the SceneManager class.
|
| |
| template<typename SceneType , typename... Args> |
| void | register_scene (const T scene_id, Args &&... args) |
| | Register a scene to be managed by the scene engine.
|
| |
| void | set_next_scene (const T scene_id) |
| | Set the next scene.
|
| |
| void | start () |
| | Main loop for the scene engine. If this is not enough, or you want to define your own loop, you can use the update and draw functions directly.
|
| |
| void | cleanup () |
| | Destroy the scene manager and clean up resources. This function is called when the scene manager is destroyed to clean up any resources used by the scene engine.
|
| |
| void | update (const float dt) |
| | Update the current scene.
|
| |
| void | draw () |
| | Draw the current scene.
|
| |
| void | set_timestep (std::chrono::nanoseconds ts) |
| | Set the fixed timestep for the game loop.
|
| |
| std::chrono::nanoseconds | get_timestep () const |
| | Get the current timestep.
|
| |
| int | get_fps () const |
| | Get the current FPS. Only applies to the managed loop.
|
| |
|
| std::shared_ptr< Scene< T > > | _active_scene { nullptr } |
| | The current scene of the scene engine.
|
| |
| T | _next_scene |
| | The next scene of the scene engine.
|
| |
| bool | _has_next_scene { false } |
| | Flag to indicate if there is a next scene to change to.
|
| |
| std::unordered_map< T, std::shared_ptr< Scene< T > > > | _scenes |
| | Collection of all scenes registered in the scene engine.
|
| |
| std::chrono::nanoseconds | _timestep { DEFAULT_TIMESTEP } |
| | Fixed timestep for the game loop.
|
| |
| int | _fps { 0 } |
| | FPS Counter for managed loop.
|
| |
template<typename T>
class asw::scene::SceneManager< T >
Forward declaration of the SceneManager class.
SceneManager class for managing game scenes.
- Template Parameters
-
| T | The type of the scene ID. |
This class manages the registration, updating, and drawing of game scenes. It also handles the transition between scenes.
Definition at line 189 of file scene.h.