engine::SceneManager class

Manages the lifecycle and stack of game scenes.

Public static functions

static auto Get() -> SceneManager&
Returns a reference to the singleton SceneManager instance.

Public functions

void SetScene(std::unique_ptr<Scene> new_scene)
Clears the stack and sets a single active scene.
void PushScene(std::unique_ptr<Scene> overlay)
Pushes an overlay scene (like a Pause Menu) onto the stack.
void PopScene()
Pops/removes the top scene on the stack (like removing the Pause Menu).

Function documentation

static SceneManager& engine::SceneManager::Get()

Returns a reference to the singleton SceneManager instance.

Returns Reference to the SceneManager.

void engine::SceneManager::SetScene(std::unique_ptr<Scene> new_scene)

Clears the stack and sets a single active scene.

Parameters
new_scene Unique pointer to the new scene.

void engine::SceneManager::PushScene(std::unique_ptr<Scene> overlay)

Pushes an overlay scene (like a Pause Menu) onto the stack.

Parameters
overlay Unique pointer to the overlay scene.