vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
system.h
1#pragma once
2
3#include <cstdint>
4
5namespace Vkm::Engine {
6
7class WindowManager;
8class Clock;
9class HostChrome;
10
11class Scene;
12class ResourceManager;
13class EventBus;
14class InputMap;
15class NetSession;
16class PoseBuffer;
17struct RenderSettings;
18struct HostView;
19struct Visibility;
20struct UIDrawData;
21struct SplashFrame;
22struct LiveParticles;
23
32enum class SystemStage : uint8_t {
33 Input = 0,
34 Simulation = 1,
35 Transform = 2,
36 Visibility = 3,
37 Render = 4,
38 Editor = 5,
39
40 Count
41};
42
56 Scene& scene;
57 ResourceManager& resources;
58
59 Clock& clock;
60 EventBus& events;
61 WindowManager& window;
62 InputMap& input;
63 NetSession& net;
64 HostChrome& chrome;
65 RenderSettings& render;
66
67 const HostView* hostView = nullptr;
68 const Visibility* visibility = nullptr;
69 const PoseBuffer* poses = nullptr;
70 const UIDrawData* ui = nullptr;
71 const SplashFrame* splash = nullptr;
72 const LiveParticles* particles = nullptr;
73};
74
80class System {
81 public:
82 virtual ~System() = default;
83
84 System(const System& other) = delete;
85 System& operator=(const System& other) = delete;
86
87 System(System && other) = delete;
88 System& operator=(System && other) = delete;
89
90 public:
104 virtual bool isReplayed() const { return false; }
105
111 virtual void init(FrameContext& ctx) {}
112
116 virtual void shutdown() {}
117
123 virtual void update(FrameContext& ctx) {}
124
136 virtual void fixedUpdate(FrameContext& ctx) {}
137
138 protected:
139 System() = default;
140};
141
142} // namespace Vkm::Engine
The engine's frame clock: real + simulation time and the fixed-step accumulator.
Definition clock.h:18
Typed pub/sub event dispatcher.
Definition event_bus.h:22
What an authoring host tells the engine about the frame it draws over.
Definition host_chrome.h:18
Named actions resolved from physical bindings, sampled once per frame.
Definition input_map.h:64
One end of a game, whether it is the authority or a guest.
Definition net_session.h:116
Every rig's pose for one frame, published on FrameContext::poses.
Definition pose_buffer.h:47
Open type-erased resource registry with typed handles and generational lifetimes.
Definition resource_manager.h:46
Central registry managing entities and an open set of component types.
Definition scene.h:29
Abstract base class for per-frame systems.
Definition system.h:80
virtual void update(FrameContext &ctx)
Execute this system for the current frame.
Definition system.h:123
virtual bool isReplayed() const
Whether this system may be re-run over a tick that already happened.
Definition system.h:104
virtual void fixedUpdate(FrameContext &ctx)
Execute this system at the fixed simulation rate.
Definition system.h:136
virtual void init(FrameContext &ctx)
Called once after all systems are registered, before the first update.
Definition system.h:111
virtual void shutdown()
Called once on engine shutdown.
Definition system.h:116
Owns the application's window, GL context, input, and frame limiting.
Definition window_manager.h:61
Per-frame state bundle passed to every system.
Definition system.h:55
const HostView * hostView
From CameraControllerSystem.
Definition system.h:67
const PoseBuffer * poses
From SkeletalAnimationSystem.
Definition system.h:69
const UIDrawData * ui
From UISystem.
Definition system.h:70
const LiveParticles * particles
From ParticleSystem.
Definition system.h:72
const Visibility * visibility
From VisibilitySystem.
Definition system.h:68
const SplashFrame * splash
From SplashSystem.
Definition system.h:71
A view an authoring host renders the frame through instead of the scene's active camera.
Definition host_view.h:18
Every emitter's live particles: ParticleSystem's per-frame product.
Definition live_particles.h:30
Editable render tuning: pass toggles + per-effect parameters.
Definition render_settings.h:86
What the splash looks like this frame, or nothing; SplashSystem's product.
Definition splash_frame.h:13
Local position, rotation and scale of an entity.
Definition transform.h:17
The backend-agnostic UI overlay for one frame, published on FrameContext::ui.
Definition ui_draw_data.h:58
VisibilitySystem's per-frame product: camera data, every scene mesh, and which of them the camera see...
Definition visibility.h:15