21 releases (12 breaking)

0.21.0 Jul 24, 2023
0.20.0 Jan 21, 2023
0.19.0 Oct 31, 2022
0.16.0 Mar 28, 2021
0.9.3 Apr 21, 2015

#33 in Game dev

Download history 509/week @ 2023-11-20 350/week @ 2023-11-27 300/week @ 2023-12-04 369/week @ 2023-12-11 482/week @ 2023-12-18 281/week @ 2023-12-25 180/week @ 2024-01-01 511/week @ 2024-01-08 370/week @ 2024-01-15 326/week @ 2024-01-22 226/week @ 2024-01-29 300/week @ 2024-02-05 485/week @ 2024-02-12 443/week @ 2024-02-19 556/week @ 2024-02-26 649/week @ 2024-03-04

2,204 downloads per month
Used in 17 crates

zlib-acknowledgement

690KB
10K SLoC

Rust 8K SLoC // 0.0% comments C++ 2.5K SLoC // 0.0% comments Shell 1 SLoC

rust-sfml Build Status crates.io Discord

Rust bindings for SFML, the Simple and Fast Multimedia Library.

Requirements

  • Linux, Windows, or OS X
  • Rust 1.66 or later
  • SFML 2.6
  • A C++ compiler for building CSFML

Environment variables

If you get errors about SFML headers not being found, or linker errors, that probably means SFML is not installed in a global location. In that case, you can set two environment variables to help rust-sfml find the required files:

  • SFML_INCLUDE_DIR. Set this to the include folder of your SFML location.
  • SFML_LIBS_DIR. Set this to the lib folder of your SFML location.

To help debugging environment variables, you can try building with cargo build -vv. If the environment variables are set correctly, you should get warnings like this:

warning: Custom SFML include dir: C:\Users\You\sfml\include
warning: Adding custom SFML libs search path C:\Users\You\sfml\lib

Documentation

The API documentation is available at: https://docs.rs/sfml/

If you need help with setting up rust-sfml on your system, you can take a look at the wiki.
Please take note that:

  • This wiki is supported by the community
  • The rust-sfml core team doesn't review it
  • Your contribution is welcome

License

This software is a binding of the SFML library created by Laurent Gomila, which is provided under the Zlib/png license.

This software is provided under the same license as SFML, the Zlib/png license.

Discord

rust-sfml users are welcome on the Official SFML Discord server

Dependencies