9#include "resource/resource_manager.h"
10#include "platform/window/window_manager.h"
11#include "core/system.h"
12#include "system/render/render_settings.h"
13#include "core/clock.h"
14#include "core/event/event_bus.h"
15#include "core/host_chrome.h"
16#include "platform/input/input_map.h"
17#include "net/net_session.h"
19namespace Vkm::Engine {
32 Engine(
const Engine& other) =
delete;
33 Engine& operator=(
const Engine& other) =
delete;
35 Engine(Engine && other) =
delete;
36 Engine& operator=(Engine && other) =
delete;
44 void setFPSLog(
bool enabled =
true) { m_fpsLog = enabled; }
62 template<
typename T,
typename... Args>
64 auto system = std::make_unique<T>(std::forward<Args>(args)...);
66 m_systemsByStage[
static_cast<size_t>(stage)].push_back(std::move(system));
70 Scene& getScene() {
return m_scene; }
71 const Scene& getScene()
const {
return m_scene; }
73 ResourceManager& getResources() {
return m_resources; }
74 const ResourceManager& getResources()
const {
return m_resources; }
76 Clock& getClock() {
return m_clock; }
77 const Clock& getClock()
const {
return m_clock; }
79 EventBus& getEvents() {
return m_events; }
80 const EventBus& getEvents()
const {
return m_events; }
90 WindowManager& getWindow() {
return m_window; }
91 const WindowManager& getWindow()
const {
return m_window; }
120 using SystemList = std::vector<std::unique_ptr<System>>;
122 void initSystems(FrameContext& ctx);
123 void shutdownSystems();
131 ResourceManager m_resources;
135 WindowManager m_window;
138 RenderSettings m_render;
140 std::array<SystemList, static_cast<size_t>(SystemStage::Count)> m_systemsByStage;
142 bool m_initialized =
false;
143 bool m_fpsLog =
false;
InputMap & getInput()
The action map gameplay reads input through.
Definition engine.h:87
NetSession & getNet()
The session this end is playing in, offline until told otherwise.
Definition engine.h:116
void setFPSLog(bool enabled=true)
Log "FPS: N (M ms)" to the console once a second.
Definition engine.h:44
RenderSettings & getRenderSettings()
The quality settings this session draws at.
Definition engine.h:107
T & addSystem(SystemStage stage, Args &&... args)
Create and register a system at the given execution stage.
Definition engine.h:63
HostChrome & getChrome()
What an authoring host says about the frame it draws over.
Definition engine.h:98
void run()
Run the main loop, blocking until the window closes or the process is interrupted.
What an authoring host tells the engine about the frame it draws over.
Definition host_chrome.h:18
One end of a game, whether it is the authority or a guest.
Definition net_session.h:116
Central registry managing entities and an open set of component types.
Definition scene.h:29
Editable render tuning: pass toggles + per-effect parameters.
Definition render_settings.h:86