From a9b9787474c6b3120202ce0bdfdff3c8e2c0ac29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sini=C5=A1a=20Bi=C4=91in?= Date: Sun, 22 Mar 2015 15:23:33 +0100 Subject: [PATCH] Update README.md with installation via Cargo. --- README.md | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 25484bc0..3b3e36c5 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,37 @@ Rust-SDL2_image Rust bindings for SDL2_image -Requirements ------------- +# Overview -* [Rust-sdl2](https://github.com/AngryLawyer/rust-sdl2) -* sdl_image 2.0 development libraries -* Rust master +Rust-SDL2_image is a library for talking to the new SDL2_image library from Rust. -Installation ------------- +Rust-SDL2_image uses the MIT license. +# Requirements + +* [Rust-SDL2](https://github.com/AngryLawyer/rust-sdl2) +* SDL_image 2.0 development libraries +* Rust master -- usage of Nightly is recommended + +# Installation + +If you're using Cargo to manage your project, enter the following into your +Cargo.toml file: + +```toml +[dependencies.sdl2_image] +git = "https://github.com/xsleonard/rust-sdl2_image" ``` + +Otherwise, clone this repo and run: + +```bash +cargo build +``` + +If you're not using Cargo, you can compile manually: + +```bash git clone https://github.com/xsleonard/rust-sdl2_image cd rust-sdl2_image rustc src/sdl2_image/lib.rs @@ -21,10 +41,18 @@ rustc src/sdl2_image/lib.rs rustc --cfg mac_framework src/sdl2_image/lib.rs ``` -Demo ----- +# Demo +You'll find included with the library a simple demo that loads and displays +a given image : + +```bash +cargo run /path/to/some/image.(jpg|png) ``` + +Or: + +```bash rustc -L. src/demo/main.rs -o demo -./demo image.[png|jpg] +./demo image.(png|jpg) ```