From 16a2a404189cc6b5cd3493df8d19298af7e542ce Mon Sep 17 00:00:00 2001 From: Lorenzo Torres Date: Sat, 29 Mar 2025 16:15:56 +0100 Subject: 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. --- src/ecs/ecs.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/ecs/ecs.zig') 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; -- cgit v1.2.3