Installing SDL2
Before going any further, we need to install the SDL library.
Installing SDL2 on Linux
Depending on your package management tool, run the following to install SDL2 on Linux:
apt package mananger
:
$ sudo apt-get install libsdl2-dev
dnf package manager
:
$ sudo dnf install SDL2-devel
yum package manager
:
$ yum install SDL2-devel
Once done, your SDL2 installation is ready!
Installing SDL2 on Mac
To install SDL2 on Mac, Simply run the following:
$ brew install sdl2
You're good to go!
Installing SDL2 on Windows
All these installation instructions come directly from the Rust SDL2 crate.
Windows with Build Script
A few steps will be required in order to make all of it work. Follow the guide!
- Download theÂ
mingw
andmsvc
development libraries from http://www.libsdl.org/ (SDL2-devel-2.0.x-mingw.tar.gz
 andÂSDL2-devel-2.0.x-VC.zip
). - Unpack to folders of your choice. (You can delete it afterward.)
- Create the following folder structure in the same folder as your
Cargo.toml
:
gnu-mingw\dll\32 ...