|
Engine
Raylib based game framework
|
Core engine. More...
#include <Engine.h>

Public Member Functions | |
| Engine (const WindowInfo &windowInfo) | |
| template<typename T , typename... Args> | |
| void | SetFirstScene (Args &&... args) |
| Sets the initial scene. | |
| void | Run (const u32 targetFps, const u32 updateFrequency, const u8 maxUpdatesPerFrame=5) |
| Runs the engine loop. | |
| Vector2 | GetVirtualMousePos () const |
| Returns the mouse position adjusted to the virtual canvas. | |
| double | GetUpdateTime () const |
| Returns how long the average update loop took in ms. | |
| double | GetDrawTime () const |
| Returns how long the average draw loop took in ms. | |
Static Public Member Functions | |
| static Engine & | Get () |
| Returns the engine instance. | |
Public Attributes | |
| Registry & | registry = m_registry |
| Dispatcher & | dispatcher = m_dispatcher |
| Renderer & | renderer = m_renderer |
| ResourceManager & | resourceManager = m_resourceManager |
| SceneManager & | sceneManager = m_sceneManager |
| SystemManager & | systemManager = m_systemManager |
| LuaManager & | luaManager = m_luaManager |
| NetworkManager & | networkManager = m_networkManager |
| BS::thread_pool< BS::tp::none > | threadPool |
Core engine.
Owns and coordinates all major subsystems.
Only a single Engine instance may exist at a time.
| Engine::Engine | ( | const WindowInfo & | windowInfo | ) |
@ brief Creates the engine and all its systems
| windowInfo | Initial window info struct |
|
static |
Returns the engine instance.
This is mainly to be used to access the public systems. If an engine hasn't been instanced the internal assert will fail.
| void Engine::Run | ( | const u32 | targetFps, |
| const u32 | updateFrequency, | ||
| const u8 | maxUpdatesPerFrame = 5 |
||
| ) |
Runs the engine loop.
This is blocking until the widow is closed or a CloseGame event is called.
Updates are called in the systems, lua, scene order. Draws are called in the renderer, systems, scene order. All drawing is done to a virtual canvas.
| targetFps | The target fps for the engine to run at |
| updateFrequency | How many update loops should be run per second |
| maxUpdatesPerFrame | Maximum updated per frame when the engine is trying to catch up |
|
inline |