raylib is a highly modular library. Everything is contained within a small number of well defined, specific and self-contained modules, each organized according to its primary functionality (nicely avoiding the huge tree of recursive dependencies, typical of other C libraries).
raylib is a highly modular library. Everything is contained within a small number of well defined, specific and self-contained modules, each organized according to its primary functionality (nicely avoiding the huge tree of recursive dependencies, typical of other C libraries).
- [`rtextures`](https://github.com/raysan5/raylib/blob/master/src/rtextures.c): Textures / Image loading and management.
- [`rtext`](https://github.com/raysan5/raylib/blob/master/src/rtext.c): Font data loading and text drawing.
- [`rmodels`](https://github.com/raysan5/raylib/blob/master/src/rmodels.c): 3D models loading and drawing.
- [`raudio`](https://github.com/raysan5/raylib/blob/master/src/raudio.c): Audio device management and sounds / music loading and playing.
- [`raudio`](https://github.com/raysan5/raylib/blob/master/src/raudio.c): Audio device management and sounds / music loading and playing.
Those seven modules share a common header, named [`raylib.h`](https://github.com/raysan5/raylib/blob/master/src/raylib.h). All API functions are defined in that header, despite being internally divided into seven modules, so the user only needs to include `raylib.h` to access all of the raylib functionality. Other libraries often use a header for every module (so users can select the ones they need), but this complicates the dependencies. The simple approach that raylib adopts is just easier for novice (and expert) users.
Those seven modules share a common header, named [`raylib.h`](https://github.com/raysan5/raylib/blob/master/src/raylib.h). All API functions are defined in that header, despite being internally divided into seven modules, so the user only needs to include `raylib.h` to access all of the raylib functionality. Other libraries often use a header for every module (so users can select the ones they need), but this complicates the dependencies. The simple approach that raylib adopts is just easier for novice (and expert) users.
Beyond the seven main modules that are described above, there is a small collection of additional modules that implement extra features:
Beyond the seven main modules that are described above, there is a small collection of additional modules that implement extra features:
- [`raymath`](https://github.com/raysan5/raylib/blob/master/src/raymath.h): Vector2, Vector3, Matrix and Quaternion math related functions.
- [`raymath`](https://github.com/raysan5/raylib/blob/master/src/raymath.h): Vector2, Vector3, Matrix and Quaternion math related functions.
- [`camera`](https://github.com/raysan5/raylib/blob/master/src/rcamera.h): 3D Camera system (free, 1st person, 3rd person, custom).
Wherever possible, raylib modules were designed to be as decoupled as possible from the other modules. In fact, some modules can be used as standalone libraries, independently of raylib, including the `rlgl` ([example](https://github.com/raysan5/raylib/blob/master/examples/others/rlgl_standalone.c)) and `raudio` ([example](https://github.com/raysan5/raylib/blob/master/examples/others/raudio_standalone.c)) modules.
Wherever possible, raylib modules were designed to be as decoupled as possible from the other modules. In fact, some modules can be used as standalone libraries, independently of raylib, including the `rlgl` ([example](https://github.com/raysan5/raylib/blob/master/examples/others/rlgl_standalone.c)) and `raudio` ([example](https://github.com/raysan5/raylib/blob/master/examples/others/raudio_standalone.c)) modules.
Most of the secondary modules (`raymath`, `camera`, `gestures`, `raygui`, `easings` and `physac`) can also be used as standalone libraries. They are distributed as configurable, single-file, header-only libraries, allowing them to be independently added to any project. Being header-only means that the file also contains function implementations. That can be extremely useful when you want to drop a library (a bunch of functions) into your codebase to provide specific functionality. However, creating a header-only module is not trivial, as the module must implement very specific functionality, while minimizing external dependencies and global variables. Simply put, it must be completely portable.
Most of the secondary modules (`raymath`, `rcamera`, `rgestures`, `raygui`, `easings` and `physac`) can also be used as standalone libraries. They are distributed as configurable, single-file, header-only libraries, allowing them to be independently added to any project. Being header-only means that the file also contains function implementations. That can be extremely useful when you want to drop a library (a bunch of functions) into your codebase to provide specific functionality. However, creating a header-only module is not trivial, as the module must implement very specific functionality, while minimizing external dependencies and global variables. Simply put, it must be completely portable.
**NOTE**: *The `raymath`, `camera` and `gestures` modules are all compiled with raylib by default.*
**NOTE**: *The `raymath`, `rcamera` and `rgestures` modules are all compiled with raylib by default.*
raylib also uses some external libraries (most of which are included as single-file, header-only libraries), including the well known [stb libraries](https://github.com/nothings/stb) and [some other similar libraries](https://github.com/raysan5/raylib/tree/master/src/external).
raylib also uses some external libraries (most of which are included as single-file, header-only libraries), including the well known [stb libraries](https://github.com/nothings/stb) and [some other similar libraries](https://github.com/raysan5/raylib/tree/master/src/external).