Setup ecs system scaffolding
This commit is contained in:
+13
-1
@@ -8,7 +8,8 @@
|
|||||||
|
|
||||||
enum Type { IMAGE,
|
enum Type { IMAGE,
|
||||||
TEXT,
|
TEXT,
|
||||||
RECT };
|
RECT,
|
||||||
|
WORLD };
|
||||||
|
|
||||||
enum ClickMode { PASS,
|
enum ClickMode { PASS,
|
||||||
BLOCK,
|
BLOCK,
|
||||||
@@ -82,6 +83,17 @@ struct ERect : Element {
|
|||||||
void render(uint64_t) override;
|
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<float> size() override;
|
||||||
|
|
||||||
|
void render(uint64_t) override;
|
||||||
|
};
|
||||||
|
|
||||||
inline Pool<Element> element_pool;
|
inline Pool<Element> element_pool;
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef ECS_H
|
||||||
|
#define ECS_H
|
||||||
|
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
|
struct Entity;
|
||||||
|
struct Component;
|
||||||
|
struct System;
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -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)
|
- 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
|
- 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
|
||||||
|
|||||||
Reference in New Issue
Block a user