Features & Modules

raylib is organized into 7 clean modules plus a thin OpenGL abstraction layer. Zero dependencies beyond the platform's graphics API.

How raylib Is Structured

raylib follows a modular, layered architecture. At the bottom sits rlgl, a thin OpenGL abstraction that supports OpenGL 1.1, 2.1, 3.3, 4.3, and ES 2.0/3.0. Above it, each module handles a specific domain — shapes, textures, text, 3D models, or audio. They're all independent and can be used separately.

raylib v5.0 architecture diagram
The 7 Modules of raylib
๐ŸชŸ
rcore
Core

Window management, input handling (keyboard, mouse, gamepad, touch), timing, random number generation, and file I/O. This is the foundation everything else builds on. Supports GLFW, SDL, RGFW, or native platform backends.

InitWindow() WindowShouldClose() SetTargetFPS() GetFrameTime() IsKeyPressed() IsMouseButtonDown() GetGamepadAxisMovement() GetTouchPosition()
๐Ÿ”ท
rshapes
2D

Drawing 2D primitives: lines, circles, rectangles, triangles, polygons, Bezier curves, and more. Includes filled and outlined variants, plus collision detection between 2D shapes.

DrawRectangle() DrawCircle() DrawTriangle() DrawPoly() DrawLineBezier() CheckCollisionRecs() CheckCollisionCircles()
๐Ÿ–ผ๏ธ
rtextures
Textures

Image loading/saving (PNG, BMP, TGA, JPG, GIF, QOI, PSD, HDR, DDS, KTX, ASTC, PKM), GPU texture management, render textures (framebuffers), image manipulation (resize, crop, rotate, color tint, dithering), and mipmapping.

LoadTexture() LoadImage() LoadRenderTexture() ImageResize() ImageCrop() GenImageColor() GenImageChecked()
๐Ÿ”ค
rtext
Text

Font loading (TTF, OTF, bitmap fonts), SDF font rendering for smooth scaling, text measurement, formatting, and Unicode support. Includes a default embedded font so you can draw text immediately without loading anything.

LoadFont() LoadFontEx() DrawText() DrawTextEx() MeasureText() GenMeshCubicmap()
๐Ÿ“ฆ
rmodels
3D

3D model loading (OBJ, IQM, GLTF, VOX, M3D), mesh generation (cube, sphere, cylinder, torus, heightmap), skeletal animation, materials, camera system with multiple modes (free, orbital, first-person, third-person), collision detection (ray-mesh, ray-box, ray-sphere), and billboard rendering.

LoadModel() DrawModel() GenMeshCube() GenMeshSphere() UpdateModelAnimation() GetRayCollisionMesh() DrawBillboard()
๐Ÿ”Š
raudio
Audio

Audio device management, sound loading (WAV, OGG, MP3, FLAC), music streaming (OGG, MP3, FLAC, XM, MOD, WAV), multi-channel mixing, audio processing callbacks for real-time effects, and spatial audio support. Powered by miniaudio.

InitAudioDevice() LoadSound() PlaySound() LoadMusicStream() UpdateMusicStream() SetAudioStreamCallback()
โšก
rlgl
OpenGL

A thin abstraction layer over OpenGL. Provides an OpenGL 1.1-style immediate-mode API that batches internally into modern OpenGL 3.3+/ES 2.0 draw calls. Handles vertex buffers, shader management, framebuffers, and render states. You almost never need to call rlgl directly — the higher modules use it internally.

rlBegin() rlEnd() rlVertex3f() rlColor4ub() rlSetTexture() rlLoadShaderCode() rlDrawRenderBatch()
Companion Libraries

raylib ships several standalone single-header libraries that can be used independently:

raymath

Vector2, Vector3, Vector4, Matrix, and Quaternion math. All inline functions, zero allocations.

raygui

Immediate-mode GUI: buttons, sliders, dropdowns, text boxes, list views, color pickers, and 15+ more controls.

rres

Resource packaging file format for bundling assets (images, fonts, sounds) into a single archive.

rpng

PNG chunk manager for embedding custom data (metadata, scripts) inside PNG files.

14 Supported Targets

raylib compiles natively on all major platforms, plus embedded and web targets:

๐ŸชŸ
Windows
MSVC, MinGW, TCC
๐Ÿง
Linux
GCC, Clang
๐ŸŽ
macOS
Clang, Apple Silicon
๐Ÿค–
Android
NDK, native activity
๐Ÿ“ฑ
iOS
Xcode toolchain
๐ŸŒ
Web
Emscripten / WASM
๐Ÿ“
Raspberry Pi
Native DRM/KMS
๐ŸŽฎ
DRM/KMS
Linux framebuffer
๐Ÿ–ฅ๏ธ
FreeBSD
GCC, Clang
๐Ÿ’ป
OpenBSD
Clang
๐Ÿ“Ÿ
SDL Backend
Any SDL2 platform
โš™๏ธ
RGFW Backend
Lightweight alternative
๐Ÿ”ฒ
GLFW Backend
Default desktop backend
๐Ÿงช
Custom Platform
Your own backend