From db229ae38f04e8a6b9759c1e5208af75b81344aa Mon Sep 17 00:00:00 2001 From: Alec Goncharow Date: Fri, 19 Jan 2024 22:39:43 -0500 Subject: initial stuff got some hexes, got some mouse picking --- src/main.zig | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/main.zig (limited to 'src/main.zig') 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()); +} -- cgit v1.2.3-70-g09d2