From 4c53e5fee603f1308b1ca070b55e341f493f16b3 Mon Sep 17 00:00:00 2001 From: Syed Daanish Date: Thu, 2 Jul 2026 13:09:11 +0100 Subject: [PATCH] Setup ecs system scaffolding --- include/app/elements.h | 14 +++++++++++++- include/ecs/ecs.h | 10 ++++++++++ writeup/analysis.md | 2 ++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 include/ecs/ecs.h diff --git a/include/app/elements.h b/include/app/elements.h index be40375..bb7b5c5 100644 --- a/include/app/elements.h +++ b/include/app/elements.h @@ -8,7 +8,8 @@ enum Type { IMAGE, TEXT, - RECT }; + RECT, + WORLD }; enum ClickMode { PASS, BLOCK, @@ -82,6 +83,17 @@ struct ERect : Element { void render(uint64_t) override; }; +struct EWorld : Element { +#warning need to implement ecs system first before implementing this + uint64_t world_id = UINT64_MAX; + + EWorld(uint64_t world_id) : Element(Type::WORLD), world_id(world_id) {} + + Vec2 size() override; + + void render(uint64_t) override; +}; + inline Pool element_pool; } // namespace app diff --git a/include/ecs/ecs.h b/include/ecs/ecs.h new file mode 100644 index 0000000..751a44c --- /dev/null +++ b/include/ecs/ecs.h @@ -0,0 +1,10 @@ +#ifndef ECS_H +#define ECS_H + +#include "utils.h" + +struct Entity; +struct Component; +struct System; + +#endif \ No newline at end of file diff --git a/writeup/analysis.md b/writeup/analysis.md index e1e87c2..dee0d94 100644 --- a/writeup/analysis.md +++ b/writeup/analysis.md @@ -320,3 +320,5 @@ Requirements v1: - then specifics of what ill need to actually make this, like the libaries, languages & hardware ill use with reasons of why, can have a big section on stuff like explaining why i chose sdl3 for rendering, or mruby (mostly because of mruby precompiling and how i can prepack the engine into a single binary) - and finally a rigid list of requirements of things it should be doing by the end with 2 priority levels and this time just the list and not any justifications this time + +# REDO section on sdl3 and mruby again