Nox Engine
 
Loading...
Searching...
No Matches
SceneManager Struct Reference

Manages the lifecycle of all scenes in the game. More...

#include <SceneManager.h>

Collaboration diagram for SceneManager:
Collaboration graph

Public Member Functions

void loadScene (std::string id)
 Loads a scene by its string identifier.
 
void loadScene (int buildIndex)
 Loads a scene by its build index.
 
void loadNextScene ()
 Loads the scene with the next sequential build index.
 
void loadPrevScene ()
 Loads the scene with the previous sequential build index.
 
ScenegetCurrentScene ()
 Gets a pointer to the currently active primary scene.
 
void addScene (Scene *scene)
 Adds a scene to the manager's collection.
 
void removeBgScene (int layer)
 Removes a background (panel) scene from a specific layer.
 
void updateScene ()
 Calls the update method on the current active scene(s).
 
void callSceneEvents (SDL_Event &event)
 Forwards SDL events to the current active scene(s).
 
void drawScene ()
 Calls the draw method on the current active scene(s).
 
void reloadScene ()
 Calls the reload method on the current active scene.
 

Detailed Description

Manages the lifecycle of all scenes in the game.

Handles loading, unloading, and routing updates and draw calls to the active scene(s).

Member Function Documentation

◆ addScene()

void SceneManager::addScene ( Scene scene)

Adds a scene to the manager's collection.

Parameters
sceneA pointer to the scene to add.
Here is the call graph for this function:

◆ callSceneEvents()

void SceneManager::callSceneEvents ( SDL_Event event)

Forwards SDL events to the current active scene(s).

Parameters
eventThe SDL_Event to process.
Here is the call graph for this function:

◆ getCurrentScene()

Scene * SceneManager::getCurrentScene ( )

Gets a pointer to the currently active primary scene.

Returns
A pointer to the current Scene.

◆ loadScene() [1/2]

void SceneManager::loadScene ( int  buildIndex)

Loads a scene by its build index.

Parameters
buildIndexThe index of the scene to load.
Here is the call graph for this function:

◆ loadScene() [2/2]

void SceneManager::loadScene ( std::string  id)

Loads a scene by its string identifier.

Parameters
idThe name of the scene to load.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeBgScene()

void SceneManager::removeBgScene ( int  layer)

Removes a background (panel) scene from a specific layer.

Parameters
layerThe layer from which to remove a scene.

The documentation for this struct was generated from the following files: