6#include "NetworkManager.h"
8#include "ResourceManager.h"
9#include "SceneManager.h"
10#include "SystemManager.h"
11#include "bsThreadPool/BS_thread_pool.hpp"
17using Entity = entt::entity;
18using Registry = entt::registry;
19using Dispatcher = entt::dispatcher;
39 Lua::RegisterType<Event::CloseGame>(lua, DemangleWithoutNamespace<Event::CloseGame>().c_str(),
60 u32 virutalWidth = 1920;
61 u32 virtualHeight = 1080;
63 bool fullscreen =
false;
64 bool borderlessFullscreen =
false;
65 bool resizable =
false;
66 bool undecorated =
false;
68 bool alwaysRun =
false;
69 bool transparent =
false;
103 template <
typename T,
typename... Args>
106 m_sceneManager.
AddScene<T>(std::forward<Args>(args)...);
124 void Run(
const u32 targetFps,
const u32 updateFrequency,
const u8 maxUpdatesPerFrame = 5);
153 Registry& registry = m_registry;
154 Dispatcher& dispatcher = m_dispatcher;
165 BS::thread_pool<BS::tp::none> threadPool;
169 static void SetFlags(
const WindowInfo& windowInfo);
176 Dispatcher m_dispatcher;
187 Vector2 m_virtualMousePos = {};
190 double m_updateTime = 0;
191 double m_drawTime = 0;
194 RenderTexture2D m_canvas;
195 u32 m_virtualWidth = 0;
196 u32 m_virtualHeight = 0;
198 bool m_running =
true;
Core engine.
Definition Engine.h:83
double GetDrawTime() const
Returns how long the average draw loop took in ms.
Definition Engine.cpp:148
void SetFirstScene(Args &&... args)
Sets the initial scene.
Definition Engine.h:104
static Engine & Get()
Returns the engine instance.
Definition Engine.cpp:153
void Run(const u32 targetFps, const u32 updateFrequency, const u8 maxUpdatesPerFrame=5)
Runs the engine loop.
Definition Engine.cpp:51
double GetUpdateTime() const
Returns how long the average update loop took in ms.
Definition Engine.cpp:143
Vector2 GetVirtualMousePos() const
Returns the mouse position adjusted to the virtual canvas.
Definition Engine.cpp:138
Definition LuaManager.h:18
Definition NetworkManager.h:13
Definition ResourceManager.h:89
Manages scenes and the the execution of the current scene.
Definition SceneManager.h:64
void AddScene(Args &&... args)
Adds a scene to the manager.
Definition SceneManager.h:99
void ChangeScene()
Queues a scene change at the end of the frame.
Definition SceneManager.h:136
Manages execution and order of systems.
Definition SystemManager.h:57
Event signalling that the game should close.
Definition Engine.h:28
static void LuaRegister(sol::state &lua)
Registers the event type with Lua.
Definition Engine.h:37
Initial window info.
Definition Engine.h:55