this repo has no description

raytracer struct

+17 -21
+3 -14
src/main.zig
··· 1 - const std = @import("std"); 1 + const Raytracer = @import("rayray").Raytracer; 2 2 3 3 pub fn main() !void { 4 - // Prints to stderr (it's a shortcut based on `std.io.getStdErr()`) 5 - std.debug.print("All your {s} are belong to us.\n", .{"codebase"}); 6 - 7 - // stdout is for the actual output of your application, for example if you 8 - // are implementing gzip, then only the compressed bytes should be sent to 9 - // stdout, not any debugging messages. 10 - const stdout_file = std.io.getStdOut().writer(); 11 - var bw = std.io.bufferedWriter(stdout_file); 12 - const stdout = bw.writer(); 13 - 14 - try stdout.print("Run `zig build test` to run the tests.\n", .{}); 15 - 16 - try bw.flush(); // don't forget to flush! 4 + const raytracer = Raytracer.init(); 5 + defer raytracer.deinit(); 17 6 }
+14 -7
src/rayray.zig
··· 1 1 const std = @import("std"); 2 - const testing = std.testing; 2 + 3 + pub const Raytracer = struct { 4 + const Self = @This(); 5 + 6 + pub fn init() Self { 7 + return .{}; 8 + } 3 9 4 - export fn add(a: i32, b: i32) i32 { 5 - return a + b; 6 - } 10 + pub fn deinit(self: *const Self) void { 11 + _ = self; 12 + } 7 13 8 - test "basic add functionality" { 9 - try testing.expect(add(3, 7) == 10); 10 - } 14 + pub fn render(self: *Self) void { 15 + _ = self; 16 + } 17 + };