blob: 5cfbe53c1efd5fa6e270316f99f75b44b10e56b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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);
//----------------------------------------------------------------------------------
}
}
|