4 #define GLFW_INCLUDE_GLCOREARB
26 class Engine :
public std::enable_shared_from_this<Engine> {
28 std::shared_ptr<ComponentManager> component_manager;
29 std::shared_ptr<Utility::FPSCounter> fps_counter;
30 std::shared_ptr<Input::InputSystem> input_system;
31 std::shared_ptr<Graphics::UI::FontGenerator> font_generator;
32 std::shared_ptr<Graphics::GraphicsSystem> graphics_system;
33 std::shared_ptr<Graphics::ShaderManager> shader_manager;
34 std::shared_ptr<Graphics::TextureManager> texture_manager;
35 std::shared_ptr<Utility::ConfigManager> config_manager;
36 std::shared_ptr<Script::ScriptingSystem> scripting_system;
40 std::map<std::shared_ptr<Game::Scene>,
bool> scenes;
42 float viewport_tile_width;
43 float viewport_tile_height;
46 std::shared_ptr<Graphics::Camera> camera_component;
48 void loadScriptingSystemSave();
55 Engine(
const std::string& config_path);
69 void addScene(std::shared_ptr<Game::Scene> scene) noexcept;
77 std::shared_ptr<Game::Scene>
findSceneByName(
const std::string& name) noexcept;
84 std::map<std::shared_ptr<Game::Scene>,
bool>
getScenes()
const noexcept;
void deactivateScene(const std::string &name)
Deactivates a scene by name.
Definition: engine.cpp:74
std::vector< std::string > getSceneNames() const noexcept
Gets the scene names.
Definition: engine.cpp:83
void cleanUp()
Cleans up before exiting.
Definition: engine.cpp:172
void activateScene(const std::string &name)
Activates a scene by name.
Definition: engine.cpp:62
void addScene(std::shared_ptr< Game::Scene > scene) noexcept
Adds a scene to the engine.
Definition: engine.cpp:30
void mainLoop()
Triggers the main loop for the engine.
Definition: engine.cpp:152
std::vector< std::string > getActiveSceneNames() const noexcept
Gets the active scene names.
Definition: engine.cpp:92
virtual ~Engine()=default
Engine destructor.
void timeToExit() noexcept
This is to signal the engine that it is time to shut down.
Definition: engine.cpp:26
std::shared_ptr< Game::Scene > findSceneByName(const std::string &name) noexcept
Finds a scene by name.
Definition: engine.cpp:34
void setup()
Sets up the engine.
Definition: engine.cpp:107
std::map< std::shared_ptr< Game::Scene >, bool > getScenes() const noexcept
Gets the scenes.
Definition: engine.cpp:57
Class for engine.
Definition: engine.h:26