Skip to content

Commit 7d29899

Browse files
committed
Demos build again. Fixes #224
1 parent 84cecb0 commit 7d29899

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name = "sdl2"
44
description = "SDL2 bindings for Rust"
55
repository = "https://github.com/AngryLawyer/rust-sdl2"
6-
version = "0.0.6"
6+
version = "0.0.7"
77
license = "MIT"
88
authors = [ "Tony Aldridge <[email protected]>" ]
99
keywords = ["SDL", "windowing", "graphics"]

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ If you're using [cargo](http://crates.io/) to manage your project, you can downl
4040

4141
```toml
4242
[dependencies]
43-
sdl2 = "0.0.6"
43+
sdl2 = "0.0.7"
4444
```
4545

4646
Alternatively, pull it from GitHub
@@ -56,9 +56,10 @@ Otherwise, clone this repo and run [cargo](http://crates.io/)
5656
5757
# Demo
5858

59-
To see an example of the code in use
59+
We have some simple example projects included:
6060

6161
> cargo run --example demo
62+
> cargo run --example audio-whitenoise
6263
6364
Some additional examples can be found in the [rs-sdl2-examples](https://github.com/jdeseno/rs-sdl2-examples) repo.
6465

examples/demo.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ extern crate sdl2;
33
pub fn main() {
44
sdl2::init(sdl2::INIT_VIDEO);
55

6-
let window = match sdl2::video::Window::new("rust-sdl2 demo: Video", sdl2::video::PosCentered, sdl2::video::PosCentered, 800, 600, sdl2::video::OPENGL) {
6+
let window = match sdl2::video::Window::new("rust-sdl2 demo: Video", sdl2::video::WindowPos::PosCentered, sdl2::video::WindowPos::PosCentered, 800, 600, sdl2::video::OPENGL) {
77
Ok(window) => window,
88
Err(err) => panic!(format!("failed to create window: {}", err))
99
};
@@ -20,13 +20,13 @@ pub fn main() {
2020
'main : loop {
2121
'event : loop {
2222
match sdl2::event::poll_event() {
23-
sdl2::event::Quit(_) => break 'main,
24-
sdl2::event::KeyDown(_, _, key, _, _, _) => {
23+
sdl2::event::Event::Quit(_) => break 'main,
24+
sdl2::event::Event::KeyDown(_, _, key, _, _, _) => {
2525
if key == sdl2::keycode::KeyCode::Escape {
2626
break 'main
2727
}
2828
},
29-
sdl2::event::None => break 'event,
29+
sdl2::event::Event::None => break 'event,
3030
_ => {}
3131
}
3232
}

src/sdl2/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#![crate_name = "sdl2"]
22
#![crate_type = "lib"]
33

4-
#![desc = "SDL2 bindings"]
5-
#![license = "MIT"]
6-
74
#![feature(default_type_params, globs, macro_rules, slicing_syntax, unsafe_destructor)]
85

96
extern crate libc;

0 commit comments

Comments
 (0)