Skip to main content

Module core

Module core 

Source
Expand description

Safe, idiomatic wrappers over raylib’s core subsystems — window, drawing, input, audio, math, models, textures, shaders, text, files, and more.

Each submodule corresponds to one slice of raylib’s C API: window wraps InitWindow / CloseWindow and the per-frame query helpers, drawing provides the RAII guards returned by begin_drawing / begin_mode2d / begin_mode3d, audio wraps the audio device plus the Wave, Sound, Music, and AudioStream types, and so on. The user-facing types (RaylibHandle, RaylibThread, RaylibBuilder, Color, Image, Texture2D, …) are re-exported by crate::prelude for the common case.

§See also

See the Window and drawing chapter of the book for the overall architecture and the per-subsystem chapters for individual modules.

Modules§

audio
Contains code related to audio. RaylibAudio plays sounds and music.
automation
Automation event recording and playback for deterministic input replay.
callbacks
Custom callback hooks for audio streams and logging.
collision
Collision detection helpers for 2D and 3D shapes.
color
Re-export module exposing the raylib Color type at core::color::Color.
data
Low-level data utilities: DEFLATE compression and Base64 encoding.
databuf
Raylib-managed memory. Similar in function to Box, but specifically designed for RL_MALLOC/RL_REALLOC/RL_FREE.
drawing
Immediate-mode drawing surfaces and RAII mode guards.
error
Definitions for error types used throughout the crate
file
File manipulation functions. Should be parity with std::fs except on emscripten
hashes
Compute CRC32, MD5, SHA-1, and SHA-256 hashes via raylib’s built-in implementations.
input
Keyboard, Controller, and Mouse related functions
logging
Functions to change the behavior of raylib logging.
math
Game-related math: Vector2, Vector3, Vector4, Matrix, and Quaternion re-exported from raylib-sys.
misc
Useful functions that don’t fit anywhere else
models
3D Model, Mesh, and Animation
pixel
Per-pixel reads and writes into raw byte buffers in a given PixelFormat.
shaders
Code for the safe manipulation of shaders
text
Text and Font related functions Text manipulation functions are super unsafe so use rust String functions
texture
Image and texture related functions
vr
VR related functions
window
Window manipulation functions

Structs§

RaylibBuilder
Fluent builder for configuring the raylib window before it is created.
RaylibHandle
The main interface into the raylib API.
RaylibThread
Token proving that the current code is executing on the raylib init thread.

Traits§

AsRawMut
Escape-hatch mutable access to a wrapper’s raw FFI value.

Functions§

init
Creates a RaylibBuilder for choosing window options before initialization.