Skip to main content

raylib_sys/
lib.rs

1//! Raw FFI bindings for [raylib](https://www.raylib.com/).
2//!
3//! The crate is unconditionally `#![no_std]` — it depends only on `core`, so
4//! it builds for embedded/no-std targets (linking raylib's C library for such
5//! a target is the consumer's responsibility; see the `nobuild` and
6//! `nobindgen` features). std consumers are unaffected. The `mint` adapter
7//! feature is no-std-compatible; `glam` and `serde` currently require a
8//! std-capable target.
9#![no_std]
10#![allow(non_upper_case_globals)]
11#![allow(non_camel_case_types)]
12#![allow(non_snake_case)]
13#![allow(clippy::approx_constant)]
14// bindgen maps C `long double` to u128 on Linux (128-bit float ABI); the generated
15// extern fns for these standard-math intrinsics are never called by raylib-rs, but
16// the `improper_ctypes` lint fires on the `include!`-d bindings.rs. Suppress it
17// crate-wide since we cannot annotate the generated file directly.
18#![allow(improper_ctypes)]
19
20#[cfg(not(feature = "nobindgen"))]
21include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
22
23#[cfg(feature = "nobindgen")]
24include!(env!("RAYLIB_BINDGEN_LOCATION"));
25
26#[cfg(target_os = "macos")]
27pub const MAX_MATERIAL_MAPS: u32 = 12;
28
29mod color;
30#[cfg(feature = "glam")]
31mod glam_conv;
32mod math;
33mod matrix_quat_math;
34#[cfg(feature = "mint")]
35mod mint_conv;
36mod vector_math;
37#[allow(unused_imports)]
38pub use color::*;
39#[allow(unused_imports)]
40pub use math::*;
41pub use matrix_quat_math::{matrix_decompose, quaternion_to_axis_angle};
42pub use vector_math::vector3_ortho_normalize;
43
44#[allow(clippy::derivable_impls)] // LOG_INFO != discriminant 0 (LOG_ALL); derived Default would return LOG_ALL
45impl Default for TraceLogLevel {
46    fn default() -> Self {
47        TraceLogLevel::LOG_INFO
48    }
49}