Features and platforms
raylib-rs uses Cargo features to gate platform back-ends, optional math integrations, and the
software renderer. The default feature set mirrors raylib 6.0’s config.h SUPPORT_* configuration:
everything a desktop OpenGL 3.3 application needs, and nothing it doesn’t.
Optional integrations — glam, mint, serde — are strictly opt-in. A default build carries zero
math-crate dependencies. The full feature alias is the canonical “everything except mutually-
exclusive back-ends” target used for CI linting and testing.
Important:
--all-featuresis invalid forraylib-sys. Always use--features fullwhen you want maximum capability in a single build invocation.
API surface
Feature flags (headline set):
opengl_33— OpenGL 3.3 core; this is the default back-end on desktop.opengl_21— OpenGL 2.1 compatibility; older hardware and some embedded targets.opengl_es_20— OpenGL ES 2.0; mobile / DRM back-end. Use withdrm.drm— DRM/KMS tty rendering; pair withopengl_es_20.wayland— Wayland display server support (Linux).software_renderer— CPU software renderer (PLATFORM=Memory, rlsw). Mutually exclusive withopengl_*. Enables theraylib::test_harnessheadless render-test module.glam—From/Intoconversions between raylib’sVector*/Matrix/Quaternionandglam::Vec*/glam::Mat4/glam::Quat.mint—From/Intoconversions withmint::Vector*/mint::ColumnMatrix*.serde—Serialize/Deserializederives on math and color types.nobuild— skip building the vendored raylib C source (you supply the link target).nobindgen— skip re-generatingraylib-sysbindings (read fromRAYLIB_BINDGEN_LOCATION).full— curated maximum-capability alias (excludes mutually-exclusive back-ends and escape hatches); use this forcargo test --features fulland CI.
Example
Three common Cargo.toml stanzas:
# 1. Default desktop build (OpenGL 3.3, no optional adapters)
[dependencies]
raylib = "6.0.0-rc.2"
# 2. Headless / CI build using the software renderer (no GPU required)
[dependencies]
raylib = { version = "6.0.0-rc.2", features = ["software_renderer"] }
# 3. Game with glam math and serde serialization
[dependencies]
raylib = { version = "6.0.0-rc.2", features = ["glam", "serde"] }
Gotchas
opengl_*features are mutually exclusive — by convention, select only one. The build script does not currently diagnose multiple selections (the last#[cfg]wins), so enabling more than one is a footgun.software_rendereris mutually exclusive withopengl_*. The two back-ends cannot be compiled into the same binary. It is also currently incompatible withwasm32-unknown-emscripten— tracked-deferred; seenotes/ws6b-complete.md.--all-featuresis invalid forraylib-sysbecause it would try to enable multiple mutually-exclusive back-ends simultaneously. Use--features fullinstead.SUPPORT_*flags — individual raylib capability flags (e.g.,SUPPORT_IMAGE_GENERATION,SUPPORT_FILEFORMAT_PNG) map directly to Cargo features of the same name. They are included infulland usually do not need to be set explicitly.
See also
- Install on Windows, macOS, Linux, Web — platform-specific dependency setup.
modules/software-renderer.md— the headless render-test harness.ecosystem/glam-mint-serde.md— the math-ecosystem integration features.