How raysan5/raylib works
raylib is a C game-programming library. The principal workflow is: an application uses the public API to initialize a platform window, process input and timing, update camera or game state, issue 2D/3D drawing and audio calls, and present results through a graphics backend. Core modules cover rendering, assets, text, models, audio, mathematics, and input helpers. The graph preserves documented platform, OpenGL, software-rendering, VR, shader, and media-format capabilities; some links are inferred from module organization because only sampled excerpts were available.
Main entry points: rlgl.h OpenGL Abstraction · platforms Platform Backends · rcore.c Core Loop · rtextures.c Textures Images
Components 20
Public API
- Raylib API
src/raylib.h
Runtime Modules
- Core Loop
src/rcore.c - 2D Shapes
src/rshapes.c - Textures Images
src/rtextures.c - Text Fonts
src/rtext.c - 3D Models
src/rmodels.c - Audio Playback
src/raudio.c - Math Types
src/raymath.h - Camera Control
src/rcamera.h - Gesture Input
src/rgestures.h
Platform Backends
- OpenGL Abstraction
src/rlgl.h - Platform Backends
src/platforms - GLFW Windowing
src/external/glfw/include/GLFW/glfw3.h - Software Renderer
src/external/rlsw.h - Shader Support
src/rlgl.h
Bundled Media
- Media Codecs
src/external - Model Loaders
src/external/cgltf.h
Other components
- Game Application
- Display GPU
- Audio Device
Connections 25
- Game Application → Raylib API: uses API
- Game Application → Core Loop: initializes loop
- Game Application → Camera Control: updates camera
- Game Application → 2D Shapes: draws shapes
- Game Application → Textures Images: loads textures
- Game Application → Text Fonts: draws text
- Game Application → 3D Models: draws models
- Game Application → Audio Playback: plays audio
- Game Application → Gesture Input: reads gestures
- Camera Control → Math Types: uses math
- Core Loop → Platform Backends: manages platform
- Core Loop → OpenGL Abstraction: controls rendering
- Platform Backends → GLFW Windowing: opens desktop window
- Platform Backends → Display GPU: presents frames
- Platform Backends → Software Renderer: selects renderer
- 2D Shapes → OpenGL Abstraction: submits geometry
- Textures Images → OpenGL Abstraction: uploads textures
- Text Fonts → OpenGL Abstraction: renders glyphs
- 3D Models → OpenGL Abstraction: submits models
- 3D Models → Model Loaders: loads model data
- Textures Images → Media Codecs: decodes images
- Audio Playback → Media Codecs: decodes audio
- Audio Playback → Audio Device: outputs samples
- OpenGL Abstraction → Display GPU: executes commands
- OpenGL Abstraction → Shader Support: uses shaders