Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 1.76 KB

GALLERY.md

File metadata and controls

44 lines (35 loc) · 1.76 KB

🪼 GALLERY

First look at running program in Terminal (st from suckless)

Running raylib example with minimal source tweaks (execution command wrapper for lib path)

Compiler Arguments

Usable.. Somewhat

I wrote a simple bit of code that renders a circle around the mouse using raylib. The editor is usable but still needs lots of work. The thing I miss the most is autocomplete, but that is mostly out of the scope of this project. Real programmers don't need no autocomplete. CODE:

// build with comp arguments `-lc -lraylib` and `LD_LIBRARY_PATH=/usr/local/lib` as pre run wrapper

const ray = @cImport({
    @cInclude("raylib.h");
});

pub fn main() void {
    const screenWidth = 800;
    const screenHeight = 450;

    ray.InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
    defer ray.CloseWindow();

    ray.SetTargetFPS(60);

    while (!ray.WindowShouldClose()) {
        ray.BeginDrawing();
        defer ray.EndDrawing();

        const mpos: ray.Vector2 = ray.GetMousePosition();
        ray.ClearBackground(ray.RAYWHITE);
        ray.DrawText("Hello, World!", 190, 200, 20, ray.LIGHTGRAY);
        ray.DrawCircle(@as(i32, @intFromFloat(mpos.x)), @as(i32, @intFromFloat(mpos.y)), 50, ray.PINK);
    }
}