SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
SceneManager Class Reference

Manages the current scene and handles scene transitions. More...

#include <SceneManager.h>

Static Public Member Functions

static SceneGetCurrentScene ()
 Gets the current scene.
 
static void SetNextScene (Scene *scene)
 Sets the next scene to transition to.
 
static Camera * GetCurrentCamera ()
 Gets the current camera.
 
static void SetCurrentCamera (Camera *cam)
 Sets the current camera.
 
static Camera * GetCurrentCamera2D ()
 Gets the current 2D camera.
 
static void SetCurrentCamera2D (Camera *cam)
 Sets the current 2D camera.
 
static TerrainGetTerrain ()
 Sets the terrain for the current scene.
 

Private Member Functions

 SceneManager (const SceneManager &)=delete
 
SceneManageroperator= (const SceneManager &)=delete
 
void privInitializeScene ()
 
void privDraw ()
 
void privUpdate ()
 
void privEndScene ()
 

Static Private Member Functions

static SceneManagerInstance ()
 
static void Delete ()
 Deletes the SceneManager instance.
 
static void InitializeScene ()
 Initializes the current scene.
 
static void UpdateScene ()
 Updates the current scene.
 
static void DrawScene ()
 Draws the current scene.
 
static void EndScene ()
 Ends the current scene.
 
static void SetCurrentScene (Scene *scene)
 Sets the current scene.
 
static void ChangeScene (Scene *scene)
 Changes the current scene to the specified scene.
 

Private Attributes

SceneCurrentScene
 Pointer to the current scene.
 
SceneDefaultScene
 Pointer to the default scene.
 
ScenePrevScene
 Pointer to the previous scene during scene transitions.
 
SceneChangeStrategypSceneChangeStrategy
 Pointer to the scene change strategy.
 

Static Private Attributes

static SceneManagerptrInstance = nullptr
 

Friends

class SceneAttorney
 

Detailed Description

Manages the current scene and handles scene transitions.

The SceneManager class is responsible for managing the current scene and handling scene transitions. It provides methods to set, get, and change the current scene, as well as to initialize, update, draw, and end the scene. It follows the Singleton design pattern.

Member Function Documentation

◆ ChangeScene()

void SceneManager::ChangeScene ( Scene * scene)
staticprivate

Changes the current scene to the specified scene.

Parameters
scenePointer to the scene to change to.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCurrentCamera()

Camera * SceneManager::GetCurrentCamera ( )
static

Gets the current camera.

Returns
Pointer to the current camera.
Here is the caller graph for this function:

◆ GetCurrentCamera2D()

Camera * SceneManager::GetCurrentCamera2D ( )
static

Gets the current 2D camera.

Returns
Pointer to the current 2D camera.
Here is the caller graph for this function:

◆ GetCurrentScene()

Scene * SceneManager::GetCurrentScene ( )
static

Gets the current scene.

Returns
Pointer to the current scene.
Here is the caller graph for this function:

◆ GetTerrain()

Terrain * SceneManager::GetTerrain ( )
static

Sets the terrain for the current scene.

Parameters
tPointer to the terrain to set.
Here is the caller graph for this function:

◆ SetCurrentCamera()

void SceneManager::SetCurrentCamera ( Camera * cam)
static

Sets the current camera.

Parameters
camPointer to the camera to set as current.

◆ SetCurrentCamera2D()

void SceneManager::SetCurrentCamera2D ( Camera * cam)
static

Sets the current 2D camera.

Parameters
camPointer to the 2D camera to set as current.

◆ SetCurrentScene()

static void SceneManager::SetCurrentScene ( Scene * scene)
inlinestaticprivate

Sets the current scene.

Parameters
scenePointer to the scene to set as current.

◆ SetNextScene()

void SceneManager::SetNextScene ( Scene * scene)
static

Sets the next scene to transition to.

Parameters
scenePointer to the next scene.

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