summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig
new file mode 100644
index 0000000..5cfbe53
--- /dev/null
+++ b/src/main.zig
@@ -0,0 +1,38 @@
+const std = @import("std");
+const rl = @import("raylib");
+
+pub fn main() anyerror!void {
+ // var frameArena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
+ // const allocator = frameArena.allocator();
+ // defer frameArena.deinit();
+
+ // Initialization
+ //--------------------------------------------------------------------------------------
+ const screenWidth = 800;
+ const screenHeight = 450;
+
+ rl.initWindow(screenWidth, screenHeight, "raylib-zig [core] example - basic window");
+ defer rl.closeWindow(); // Close window and OpenGL context
+
+ rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second
+ rl.setExitKey(.caps_lock);
+ //--------------------------------------------------------------------------------------
+
+ // Main game loop
+ while (!rl.windowShouldClose()) { // Detect window close button or ESC key
+ // Update
+ //----------------------------------------------------------------------------------
+ // TODO: Update your variables here
+ //----------------------------------------------------------------------------------
+
+ // Draw
+ //----------------------------------------------------------------------------------
+ rl.beginDrawing();
+ defer rl.endDrawing();
+
+ rl.clearBackground(.white);
+
+ rl.drawText("Congrats! You created your first window!", 190, 200, 20, .light_gray);
+ //----------------------------------------------------------------------------------
+ }
+}