fabapp/src/main.zig

29 lines
985 B
Zig
Raw Normal View History

2023-10-04 14:20:49 +02:00
const std = @import("std");
2023-10-13 15:53:58 +02:00
const raylib = @import("raylib.zig");
2023-10-04 14:20:49 +02:00
const sqlite = @cImport({
@cInclude("sqlite3.h");
});
2023-10-04 14:20:49 +02:00
pub fn main() !void {
2023-10-04 14:20:49 +02:00
const screen_width = 800;
const screen_height = 450;
raylib.InitWindow(screen_width, screen_height, "raylib [core] example - basic window");
raylib.SetTargetFPS(60);
while (!raylib.WindowShouldClose()) {
raylib.BeginDrawing();
defer raylib.EndDrawing();
2023-10-04 14:20:49 +02:00
2023-10-04 14:20:49 +02:00
raylib.ClearBackground(raylib.RAYWHITE);
raylib.DrawText("Congrats! You created your first window!", 190, 200, 20, raylib.LIGHTGRAY);
2023-10-13 15:53:58 +02:00
if (raylib.GuiButton(.{ .x = 0, .y = 0, .width = 100, .height = 100 }, "MyButton") == 1) {}
2023-10-04 14:20:49 +02:00
}
raylib.CloseWindow();
2023-10-04 14:20:49 +02:00
}
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());
}