feat: initial commit

This commit is contained in:
2025-07-22 18:11:39 +02:00
commit 3f6f7cb79e
5 changed files with 204 additions and 0 deletions

27
src/main.zig Normal file
View File

@@ -0,0 +1,27 @@
const std = @import("std");
const rl = @import("raylib");
pub fn main() anyerror!void {
const alloc = std.heap.page_allocator;
const screenWidth = 800;
const screenHeight = 450;
rl.initWindow(screenWidth, screenHeight, "Snake");
defer rl.closeWindow();
rl.setTargetFPS(100);
while (!rl.windowShouldClose()) {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(.white);
const info = try std.fmt.allocPrintZ(alloc, "FPS: {}\n", .{rl.getFPS()});
rl.drawText("Congrats! You created your first window!", 190, 200, 20, .light_gray);
rl.drawText(info, 0, 0, 20, .light_gray);
rl.drawRectangle(10, 10, 10, 10, .black);
}
}