root module nu_options

This commit is contained in:
David Allemang
2024-07-09 14:39:16 -04:00
parent 59c38925fd
commit 1613b90ac5
5 changed files with 438 additions and 375 deletions

View File

@@ -1,9 +1,13 @@
const std = @import("std");
const nu = @import("nu.zig");
const App = @import("App.zig");
pub const nu_options: nu.Options = .{
.window = .{ .title = "Hello World" },
.render = .{ .app_name = "hello-world" },
};
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.detectLeaks();
@@ -13,7 +17,10 @@ pub fn main() !void {
// problem: how to specify runtime options, like Window title?
// problem: where should gpa go? probably some "Engine" structure in nu.zig
try nu.Window.init(alloc, .{ .title = "Hello World" });
// don't necessarily need to declare topological sort - depth-first traversal
// of each module's dependencies without repeats would do.
try nu.Window.init(alloc);
defer nu.Window.deinit();
try nu.Render.init(alloc);