use NativeCall; class Color is repr('CStruct') { has uint8 $.r; has uint8 $.g; has uint8 $.b; has uint8 $.a; } sub InitWindow(int32, int32, Str) is native('raylib.dll') { * } sub SetTargetFPS(int32) is native('raylib.dll') { * } sub WindowShouldClose() returns int32 is native('raylib.dll') { * } sub BeginDrawing() is native('raylib.dll') { * } sub EndDrawing() is native('raylib.dll') { * } sub CloseWindow() is native('raylib.dll') { * } sub ClearBackground(Color) is native('raylib.dll') { * } sub DrawText(Str, int32, int32, int32, Color) is native('raylib.dll') { * } InitWindow(800, 450, "Hello world!"); SetTargetFPS(60); my $color = Color.new(r => 255, g => 0, b => 0, a => 255); my $textColor = Color.new(r => 0, g => 0, b => 255, a => 255); while (!WindowShouldClose()) { BeginDrawing(); ClearBackground($color); DrawText("Congrats! You created your first window!", 190, 200, 20, $textColor); EndDrawing(); } CloseWindow();