Source files → library
| File | Module flag | Role |
|---|---|---|
rcore.c | mandatory | Core + included platform |
rlgl.h | mandatory | GL impl inside rcore |
rshapes.c | SUPPORT_MODULE_RSHAPES | 2D draw + collision |
rtextures.c | SUPPORT_MODULE_RTEXTURES | Images & textures |
rtext.c | SUPPORT_MODULE_RTEXT | Fonts (needs rtextures) |
rmodels.c | SUPPORT_MODULE_RMODELS | 3D models |
raudio.c | SUPPORT_MODULE_RAUDIO | Audio |
rglfw.c | desktop GLFW | Vendored GLFW (separate .o in Make) |
GNU Make (common on Linux)
cd raylib/src
make PLATFORM=PLATFORM_DESKTOP
cd raylib/examples
make core/core_basic_window
./core/core_basic_window
Key flags: PLATFORM, GRAPHICS, RAYLIB_BUILD_MODE=RELEASE, RAYLIB_CONFIG_FLAGS for custom defines.
CMake
cmake -B build -DPLATFORM=Desktop -DBUILD_EXAMPLES=ON
cmake --build build
./build/examples/core/core_basic_window
CUSTOMIZE_BUILD=ON exposes every SUPPORT_* flag. OPENGL_VERSION selects graphics API.
Zig build
zig build
zig build core_basic_window # run example
Options: -Dplatform=glfw|sdl2|drm|…, -Dopengl_version=gles_2, module toggles -Draudio=false, etc.
Public headers
raylib.h— main APIraymath.h— math (standalone with RAYMATH_IMPLEMENTATION)rlgl.h— GL layer (standalone with RLGL_IMPLEMENTATION)rcamera.h,rgestures.h— optional helpers
Tooling in repo
tools/rlparser— parsesraylib.h→ JSON/XML for bindingstools/rexm— validates and updates the examples collection
No unit test suite — CI compiles library + examples on Linux, Windows, macOS, Android, Web.
Notable config defaults
SUPPORT_CUSTOM_FRAME_CONTROL 0— EndDrawing owns swap/pollSUPPORT_GPU_SKINNING 0— CPU bone skinning defaultSUPPORT_FILEFORMAT_JPG 0— JPG off unless enabledRL_DEFAULT_BATCH_BUFFER_ELEMENTS 4096— batch capacity
Dependency direction
raylib.h (types)
│
rcore ──► rlgl ◄── rshapes, rtextures, rtext, rmodels
│ rtext ──► rtextures
│ rmodels ──► rtextures, raymath
└──► platform/*.c (included)
raudio ──► miniaudio (independent)