summaryrefslogtreecommitdiff
path: root/src/ecs/ecs.zig
diff options
context:
space:
mode:
authorLorenzo Torres <torres@sideros.org>2025-03-29 16:15:56 +0100
committerLorenzo Torres <torres@sideros.org>2025-03-29 16:15:56 +0100
commit16a2a404189cc6b5cd3493df8d19298af7e542ce (patch)
treeeb53b701149498ef0716922c755524f2a8a42821 /src/ecs/ecs.zig
parentfd7973173f163e068deb0ae8f9d6ff0fc31fc71b (diff)
moved rendering to a system.
To ensure that the rendering system is being run in the main thread, I added the concept of "Sync systems", so that when a system group is created it's possible to specify whether it's possible to run it on a separate thread or not.
Diffstat (limited to 'src/ecs/ecs.zig')
-rw-r--r--src/ecs/ecs.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ecs/ecs.zig b/src/ecs/ecs.zig
index e389223..4ec765f 100644
--- a/src/ecs/ecs.zig
+++ b/src/ecs/ecs.zig
@@ -1,7 +1,12 @@
pub const components = @import("components.zig");
pub const entities = @import("entities.zig");
+pub const SystemError = error{
+ fail,
+ die,
+};
+
pub const Pool = entities.Pool;
pub const Resources = entities.Resources;
-pub const System = *const fn (*Pool) void;
+pub const System = *const fn (*Pool) anyerror!void;
pub const SystemGroup = []const System;