diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-03 14:50:13 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-03 14:50:13 +0900 |
| commit | 294e12c3d6c702e16284a46877ebfa79a4506ee2 (patch) | |
| tree | e403273342ebf85eb5fc7f02c8ffa85136d29f41 /src | |
| parent | d95640d95cd58bd392ee4e8ad0b0a26b65b0adce (diff) | |
| download | RayTracingInOneWeekend.zig-main.tar.gz RayTracingInOneWeekend.zig-main.tar.zst RayTracingInOneWeekend.zig-main.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.zig | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig index 060c6ee..9783ca3 100644 --- a/src/main.zig +++ b/src/main.zig @@ -292,10 +292,8 @@ fn generateCornellBox(allocator: anytype) !Hittable { return .{ .list = .{ .objects = hittable_objects } }; } -pub fn main() !void { - var gpa = std.heap.GeneralPurposeAllocator(.{}){}; - const allocator = gpa.allocator(); - defer std.debug.assert(gpa.deinit() == .ok); +pub fn main(init: std.process.Init) !void { + const allocator = init.gpa; var rng_ = std.Random.DefaultPrng.init(42); const rng = rng_.random(); @@ -403,5 +401,5 @@ pub fn main() !void { // Output var write_buf: [zigimg.io.DEFAULT_BUFFER_SIZE]u8 = undefined; - try image.writeToFilePath(allocator, "out.png", write_buf[0..], .{ .png = .{} }); + try image.writeToFilePath(allocator, init.io, "out.png", write_buf[0..], .{ .png = .{} }); } |
