examples: add initial ecs-app

This is a temporary application to begin iterating on high-level ECS applications.

Eventually, this will be removed - for now it's just here so we can see how this API
looks today and improve it.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-04 22:19:35 -07:00 committed by Stephen Gutekanst
parent 6ec27861b4
commit d3b03901fb
4 changed files with 96 additions and 1 deletions

View file

@ -0,0 +1,13 @@
const mach = @import("mach");
const ecs = mach.ecs;
pub const module = ecs.Module(.{
.components = .{
.location = Vec3,
.rotation = Vec3,
},
// TODO: there would be systems that we register here. Functions that iterate over entities
// with renderer components like `.geometry` and render them for example!
});
pub const Vec3 = struct { x: f32, y: f32, z: f32 };