diff --git a/src/main.zig b/src/main.zig index 6e82cc7..9063123 100644 --- a/src/main.zig +++ b/src/main.zig @@ -17,12 +17,14 @@ pub fn main() !void { const alloc = gpa.allocator(); // todo declare or infer module dependencies, topological sort for init order - // problem: how to specify runtime options, like Window title? // problem: where should gpa go? probably some "Engine" structure in nu.zig // don't necessarily need to declare topological sort - depth-first traversal // of each module's dependencies without repeats would do. + // idea - use a structure like std.Build.Step where the polymorphic part is a + // component of the larger structure. + try nu.Window.init(alloc); defer nu.Window.deinit(); diff --git a/src/nu/Render.zig b/src/nu/Render.zig index 952db90..9dcd518 100644 --- a/src/nu/Render.zig +++ b/src/nu/Render.zig @@ -92,6 +92,11 @@ pub fn frame() !void { for (present_callbacks.items) |cb| { cb(cmd); } + + // todo really don't like this. + // there should be some comptime means for a module to invoke hooks on other modules. eg there should be some + // "record" hook that for each module that gets called here; but if the render module is never added then that + // hook never gets called target.end_rendering(cmd); try cmd.endCommandBuffer();