doggo/src/main.zig

32 lines
863 B
Zig
Raw Normal View History

2022-01-21 15:12:40 +01:00
const std = @import("std");
2022-01-22 14:42:40 +01:00
const ray = @cImport({
@cInclude("raylib.h");
});
2022-03-24 13:25:40 +01:00
const raygui = @cImport({
@cDefine("RAYGUI_IMPLEMENTATION", {});
@cInclude("extras/raygui.h");
});
2022-01-21 15:12:40 +01:00
pub fn main() anyerror!void {
std.log.info("All your codebase are belong to us.", .{});
2022-01-22 14:42:40 +01:00
ray.InitWindow(800, 450, "ray [core] example - basic window");
defer ray.CloseWindow();
2022-03-24 13:25:40 +01:00
while (!ray.WindowShouldClose()) {
2022-01-22 14:42:40 +01:00
ray.BeginDrawing();
defer ray.EndDrawing();
ray.ClearBackground(ray.RAYWHITE);
ray.DrawText("Congrats! You created your first window!", 190, 200, 20, ray.LIGHTGRAY);
2022-03-24 13:25:40 +01:00
if (raygui.GuiButton(raygui.Rectangle{ .x = 190, .y = 250, .width = 150, .height = 30 }, "Button")) {
std.log.info("Button pressed", .{});
}
}
2022-01-21 15:12:40 +01:00
}
test "basic test" {
try std.testing.expectEqual(10, 3 + 7);
}