souleng
Game engine providing full Python scripting support
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
SceneManager Struct Reference

Singleton manager for running the active scenes and swapping scenes out. More...

#include <SceneManager.hpp>

Public Member Functions

void AddScene (std::string sceneName, pybind11::module_ sceneScript)
 
void ChangeActiveScene (std::string sceneName)
 
void RunActiveScene (float dt)
 
void EndGame ()
 Callable from scripts to signal that the game should be terminated.
 
bool GameEnded ()
 Callable from C++ to check if the game should be terminated.
 

Static Public Member Functions

static SceneManagerinstance ()
 Singleton accessor.
 

Detailed Description

Singleton manager for running the active scenes and swapping scenes out.

Member Function Documentation

◆ AddScene()

void SceneManager::AddScene ( std::string sceneName,
pybind11::module_ sceneScript )

Adds a scene to the game under a given key

Parameters
sceneNameThe key by which the scene can be accessed
sceneScriptThe python module which contains the logic for the scene

◆ ChangeActiveScene()

void SceneManager::ChangeActiveScene ( std::string sceneName)

Changes the active scene, shutting down the previous one and starting up the new one

Parameters
sceneNameThe name of the scene to switch to

◆ RunActiveScene()

void SceneManager::RunActiveScene ( float dt)

Runs the Input, Update, and Draw methods on the active scene

Parameters
dtThe delta time used for the Update method

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