summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-07-25 18:35:58 +0300
committerKyren223 <Kyren223@proton.me>2025-07-25 18:35:58 +0300
commitddf14daac53f3a926bc5910e75f5bdfdf435c781 (patch)
treecf78886d4bf3ee2fa606fbb80539773eec758835 /src
Initial commit
Diffstat (limited to 'src')
-rw-r--r--src/lib.c1
-rw-r--r--src/main.zig38
2 files changed, 39 insertions, 0 deletions
diff --git a/src/lib.c b/src/lib.c
new file mode 100644
index 0000000..a82b12f
--- /dev/null
+++ b/src/lib.c
@@ -0,0 +1 @@
+#include "lib.h"
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);
+ //----------------------------------------------------------------------------------
+ }
+}