38 static inline float TickRate = 1.0f / 30.0f;
40 Engine(std::unique_ptr<Window> window);
43 void submitRender(
RenderContext&& ctx,
bool immediate =
false);
51 void subscribeUpdate(std::shared_ptr<Updateable> updateable);
52 void subscribeTick(std::shared_ptr<Tickable> tickable);
53 void fireUpdate(
float dt);
56 virtual void beforeRender() {};
57 virtual void render(
double dt) = 0;
58 virtual void afterRender() {};
60 Window* window()
const {
return m_window.get(); }
61 InputSystem* inputSystem()
const {
return m_inputSystem.get(); }
63 void setDirectionalLightSource(std::shared_ptr<Sun> lightSource, uint8_t passPosition = 0);
64 std::shared_ptr<Sun> directionalLightSource()
const {
return m_directionalLightSource; }
67 std::unique_ptr<InputSystem> m_inputSystem;
68 std::shared_ptr<Sun> m_directionalLightSource;
71 std::vector<std::variant<RenderContext, GroupRenderContext>> m_renderQueue;
72 std::unique_ptr<Window> m_window;
78 void initUtilityShaders();
80 std::vector<std::weak_ptr<Updateable>> m_updateSubscribers;
81 std::vector<std::weak_ptr<Tickable>> m_tickSubscribers;
82 float m_tickAccumulator = 0.0f;
Definition RenderContext.h:82
Definition RenderContext.h:45