CS4850 Final Project
Loading...
Searching...
No Matches
SceneManager.hpp
1#pragma once
2
3#include <SDL2/SDL.h>
4#include "Scene.hpp"
5#include "Application.hpp"
6
12
19 if (nullptr == mInstance) {
20 mInstance = new SceneManager;
21 }
22
23 return *mInstance;
24 }
25
31 void SetCurrentScene(std::shared_ptr<Scene> scene) {
32 mCurrentScene = scene;
33 }
34
40 const std::shared_ptr<Scene> GetCurrentScene() {
41 return mCurrentScene;
42 }
43
44 private:
45 SceneManager() {
46 }
47
48 std::shared_ptr<Scene> mCurrentScene; // Stores a pointer to the current scene
49
50 inline static SceneManager* mInstance {nullptr};
51};
Singleton class that manages scenes.
Definition SceneManager.hpp:11
static SceneManager & Instance()
Get the instance of the SceneManager.
Definition SceneManager.hpp:18
const std::shared_ptr< Scene > GetCurrentScene()
Get the current scene.
Definition SceneManager.hpp:40
void SetCurrentScene(std::shared_ptr< Scene > scene)
Set the current scene.
Definition SceneManager.hpp:31