An SDL2 template for Rust, targeting Linux, MacOS, and Windows (x64 MSVC) builds.
Ensure cargo-generate
is installed:
cargo install cargo-generate
And generate with:
cargo generate --git hgalant/sdl2_rust_template
Note: The template's build script assumes the environment variable
CARGO_TARGET_DIR
is unset when building for Windows.
-
For Linux/MacOS builds: install SDL2 and other necessary packages (e.g. SDL_image) via your package-manager (more details here).
-
For Windows builds: library files are included for SDL2, SDL_image, and SDL_ttf in
lib/
. You can remove unnecessary or add unincluded SDL dependencies (e.g. SDL_mixer) as needed.