aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/core
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-10-08 15:43:45 +0200
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-10-08 15:43:45 +0200
commitafdd12277a43d3ad7755f028e85c569dece84f0b (patch)
tree1b619bbd2c95cb676c53f2410a94dd16b5fb54fe /src/crepe/core
parent035444c1b7ee2e76c235e16eafd6115e849eec73 (diff)
rendering system
Diffstat (limited to 'src/crepe/core')
-rw-r--r--src/crepe/core/CMakeLists.txt8
-rw-r--r--src/crepe/core/renderSystem.cpp37
-rw-r--r--src/crepe/core/renderSystem.h13
3 files changed, 58 insertions, 0 deletions
diff --git a/src/crepe/core/CMakeLists.txt b/src/crepe/core/CMakeLists.txt
new file mode 100644
index 0000000..c44f0f6
--- /dev/null
+++ b/src/crepe/core/CMakeLists.txt
@@ -0,0 +1,8 @@
+target_sources(crepe PUBLIC
+ renderSystem.cpp
+)
+
+target_sources(crepe PUBLIC FILE_SET HEADERS FILES
+ renderSystem.h
+)
+
diff --git a/src/crepe/core/renderSystem.cpp b/src/crepe/core/renderSystem.cpp
new file mode 100644
index 0000000..a06aeba
--- /dev/null
+++ b/src/crepe/core/renderSystem.cpp
@@ -0,0 +1,37 @@
+
+
+
+#include "renderSystem.h"
+#include <vector>
+
+#include "api/Color.h"
+#include "api/Sprite.h"
+#include "api/Transform.h"
+#include "facade/SdlContext.h"
+#include "facade/Texture.h"
+
+using namespace crepe::api;
+
+
+static crepe::Texture player("../asset/texture/img.png");
+
+
+void RenderSystem::render(){
+
+ Sprite sprite(player, Color::get_red(), {1,1});
+ Transform transform ={
+ .position = {0,0},
+ .rotation = 0,
+ .scale = 1,
+ };
+
+ // this will get changed to ecs getter of componets
+ crepe::SdlContext& ctx = crepe::SdlContext::get_instance();
+
+ ctx.draw(sprite, transform);
+ /*
+ for(const auto& S : test_objects){
+ ctx.draw(S, const api::Transform &)
+ }
+ */
+}
diff --git a/src/crepe/core/renderSystem.h b/src/crepe/core/renderSystem.h
new file mode 100644
index 0000000..9011b30
--- /dev/null
+++ b/src/crepe/core/renderSystem.h
@@ -0,0 +1,13 @@
+
+#pragma once
+
+
+
+class RenderSystem {
+
+public:
+ RenderSystem() = default;
+ ~RenderSystem() = default;
+
+ void render();
+};