diff options
| author | Alec Goncharow <alec@goncharow.dev> | 2024-01-19 22:39:43 -0500 |
|---|---|---|
| committer | Alec Goncharow <alec@goncharow.dev> | 2024-01-19 22:39:43 -0500 |
| commit | db229ae38f04e8a6b9759c1e5208af75b81344aa (patch) | |
| tree | 1cdd2eda0b2c71d0c5f5f16e25a362cdd9d41904 /src/main.zig | |
initial stuff
got some hexes, got some mouse picking
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()); +} |
