From 1632e53eae718b40d2004b37c56bd08d65e76c74 Mon Sep 17 00:00:00 2001 From: copygirl Date: Sat, 2 Sep 2023 21:02:43 +0200 Subject: [PATCH] Add World.initMinimal --- src/world.zig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/world.zig b/src/world.zig index 0c3a88a..c583340 100644 --- a/src/world.zig +++ b/src/world.zig @@ -32,6 +32,13 @@ pub fn World(comptime ctx: anytype) type { return result; } + pub fn initMinimal(alloc: Allocator) !*Self { + var result = try alloc.create(Self); + result.raw = c.ecs_mini().?; + result.allocator = alloc; + return result; + } + pub fn deinit(self: *Self) void { _ = c.ecs_fini(self.raw); self.allocator.destroy(self);