Standard Library
std.raylib
Native Raylib bindings. Requires an installed Raylib library. C symbol names are preserved. See docs/guide/native-bindings.md for ABI rules. Struct calls currently require arm64 macOS. Checked against Raylib 6.0.
Exported functions
Configure window flags before InitWindow.
Set the minimum size of a resizable window.
Load an image file into GPU memory; requires an open graphics context. Check IsTextureValid, then pair each successful load with one UnloadTexture.
Validate texture metadata after loading; this does not detect a previously unloaded handle.
Release a texture before closing its graphics context. Never use any copies afterward.
Draw a texture at an integer position.
Draw a texture at a two-dimensional position.
Draw part of a texture with scaling and rotation.
Choose a texture scaling filter.
Create the window and graphics context. Call from the main thread.
Close the window and release its graphics context.
Check whether the close button or exit key requested shutdown.
Check whether window initialization succeeded.
Change the window title. Raylib retains this read-only string.
Resize the window.
Get the window's logical width.
Get the window's logical height.
Begin drawing a frame.
Present the frame and process timing/input.
Clear the frame using rlgl's current clear color (black by default). Prefer ClearBackground for the public drawing API.
Draw the current frame rate at a screen position.
Clear the frame to a color.
Draw a filled circle at a two-dimensional position.
Draw a filled rectangle.
Draw text using the default font; the string is borrowed for this call only.
Get the mouse position in screen coordinates.
Return a color with the supplied alpha between zero and one.
Return the intersection of two rectangles.
Limit the frame rate.
Return the most recent frame's duration in seconds.
Return elapsed time since initialization, in seconds.
Test whether a keyboard key is held down.
Test whether a keyboard key was pressed this frame.
Seed Raylib's random number generator.
Return a random integer in the inclusive range.
Run a callback with an open window, then close it. Returns false on initialization failure. Call on the main thread; windows cannot be nested (Raylib has one global context). The callback may return early. It cannot throw; panic/exit/process termination bypass cleanup. Release textures inside the callback, before this helper closes the graphics context.
Borrow a loaded texture for a callback, then unload it. Returns false if loading fails. Do not unload the borrowed texture or retain/use copies outside the callback. Panic/exit/process termination bypass cleanup; this is not automatic ownership checking.
Pair BeginDrawing/EndDrawing around a non-throwing callback, including early returns.