20 releases (breaking)

Uses old Rust 2015

1.1.0 Mar 1, 2016
0.25.0 Nov 5, 2016
0.21.0 Jul 7, 2016
0.16.0 Mar 24, 2016
0.0.33 Mar 29, 2015

#571 in Graphics APIs

Download history 216/week @ 2023-10-27 170/week @ 2023-11-03 125/week @ 2023-11-10 181/week @ 2023-11-17 190/week @ 2023-11-24 179/week @ 2023-12-01 179/week @ 2023-12-08 183/week @ 2023-12-15 188/week @ 2023-12-22 93/week @ 2023-12-29 173/week @ 2024-01-05 168/week @ 2024-01-12 177/week @ 2024-01-19 136/week @ 2024-01-26 76/week @ 2024-02-02 155/week @ 2024-02-09

575 downloads per month
Used in 2 crates (via mold2d)

MIT license

18KB
373 lines

Rust-SDL2_image

Rust bindings for SDL2_image

NOTE: The 1.0.0 and 1.1.0 version of this crate are yanked because of #65! We are now using same x.y._ version number as sdl2. See sdl2_image/0.25.0.

Overview

Rust-SDL2_image is a library for talking to the new SDL2_image library from Rust.

Rust-SDL2_image uses the MIT license.

Requirements

Documentation

Installation

If you're using Cargo to manage your project, enter the following into your Cargo.toml file:

[dependencies]
sdl2 = "0.25.0"
sdl2_image = "0.25.0"

Or, to reference this repository directly:

[dependencies.sdl2_image]
git = "https://github.com/xsleonard/rust-sdl2_image"

Otherwise, clone this repo and run:

cargo build

If you're not using Cargo, you can compile manually:

git clone https://github.com/xsleonard/rust-sdl2_image
cd rust-sdl2_image
rustc src/sdl2_image/lib.rs
# OR if you are using the mac framework version
rustc --cfg mac_framework src/sdl2_image/lib.rs

Demo

You'll find included with the library a simple demo that loads and displays a given image :

cargo run /path/to/some/image.(jpg|png)

Or:

rustc -L. src/demo/main.rs -o demo
./demo image.(png|jpg)

Dependencies

~17MB
~364K SLoC