diff options
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig new file mode 100644 index 0000000..a3cfd2f --- /dev/null +++ b/src/main.zig @@ -0,0 +1,31 @@ +const std = @import("std"); +const rl = @cImport(@cInclude("raylib.h")); +const root = @import("root.zig"); +const context = @import("context.zig"); + +pub fn main() !void { + const win_width = 960; + const win_height = 540; + rl.InitWindow(win_width, win_height, "shipit"); + + rl.SetTargetFPS(60); + defer rl.CloseWindow(); + + // Game State Initialization + try root.setup(); + // + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!rl.WindowShouldClose()) { + try root.update(); + try root.draw(); + } +} + +test "simple test" { + var list = std.ArrayList(i32).init(std.testing.allocator); + defer list.deinit(); // try commenting this out and see if zig detects the memory leak! + try list.append(42); + try std.testing.expectEqual(@as(i32, 42), list.pop()); +} |
