Kaynağa Gözat

testbed: setup hud system for later use

skypjack 10 ay önce
ebeveyn
işleme
1796b18284

+ 1 - 0
testbed/CMakeLists.txt

@@ -51,6 +51,7 @@ target_sources(
 	PRIVATE
         application/application.cpp
         application/context.cpp
+        system/hud_system.cpp
         system/imgui_system.cpp
         system/input_system.cpp
         system/rendering_system.cpp

+ 2 - 0
testbed/application/application.cpp

@@ -6,6 +6,7 @@
 #include <backends/imgui_impl_sdlrenderer3.h>
 #include <entt/entity/registry.hpp>
 #include <imgui.h>
+#include <system/hud_system.h>
 #include <system/imgui_system.h>
 #include <system/input_system.h>
 #include <system/rendering_system.h>
@@ -26,6 +27,7 @@ void application::draw(entt::registry &registry, const context &context) const {
     SDL_RenderClear(context);
 
     rendering_system(registry, context);
+    hud_system(registry, context);
     imgui_system(registry);
 
     ImGui::Render();

+ 13 - 0
testbed/system/hud_system.cpp

@@ -0,0 +1,13 @@
+#include <application/context.h>
+#include <entt/entity/registry.hpp>
+#include <system/hud_system.h>
+
+namespace testbed {
+
+void hud_system(entt::registry &registry, const context &ctx) {
+    // render...
+    static_cast<void>(registry);
+    static_cast<void>(ctx);
+}
+
+} // namespace testbed

+ 11 - 0
testbed/system/hud_system.h

@@ -0,0 +1,11 @@
+#pragma once
+
+#include <entt/entity/fwd.hpp>
+
+namespace testbed {
+
+struct context;
+
+void hud_system(entt::registry &, const context &);
+
+} // namespace testbed