Expand description
Bindings to the SDL2 C library.
By default the crate will dynamically link to the system installed version of SDL2. The crate provides bindings for most of the 2.0.16 APIs, but your system version of SDL2 might be older or newer than that. For example, Debian Bullseye is on 2.0.14, but Debian Bookworm has updated to 2.24.1 (note that in between SDL2 changed their version number policy, so new versions now update the middle value). On Windows MSVC the “system” version will be SDL2’s official pre-built development files that come bundled in the crate.
If you use the static_bundled_build
cargo feature then this will build
SDL2 using a bundled copy of the source and then statically link to that.
Building SDL2 can take a bit during that first build (usually 1 minute or
more).
Crate Features
cargo_check
: This causes the entire build.rs to exit early. This is useful if you don’t need to make an executable, such ascargo check
orcargo doc
.
Modules
Structs
Enums
Constants
SDL_INIT_GAMECONTROLLER
implies SDL_INIT_JOYSTICK
SDL_INIT_JOYSTICK
implies SDL_INIT_EVENTS
SDL_INIT_VIDEO
implies SDL_INIT_EVENTS
Functions
flags
.Type Definitions
char
type.double
type.float
type.signed int
(int
) type.signed long
(long
) type.signed long long
(long long
) type.signed char
type.signed short
(short
) type.unsigned char
type.unsigned int
type.unsigned long
type.unsigned long long
type.unsigned short
type.