Skip to content

Commit b9bf1be

Browse files
committed
Update readme
1 parent f0d15db commit b9bf1be

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

README.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@ CSFML2 : http://www.sfml-dev.org/download/csfml/
1818

1919
Then clone the repo and build the library with the following command.
2020

21+
Rust-sfml is now build with the rustpkg tool :
22+
2123
```Shell
22-
> rustc rsfml.rc
23-
>
24+
> rustpkg build rsfml
2425
```
25-
Finally build your program with the rust-sfml library. For exemple, if the library is in the same path than your program.
26+
27+
Examples are build too with rustpkg :
2628

2729
```Shell
28-
> rustc main.rs -L .
29-
>
30+
> rustpkg build examples/pong
3031
```
3132

32-
Normaly rust-sfml works on Linux and windows and OSX.
33+
Rust-sfml works on Linux, windows and OSX.
3334

3435
OSX Specific
3536
============
@@ -50,16 +51,31 @@ Short example
5051
Here is a short example, draw a circle shape and display it.
5152

5253
```Rust
54+
extern mod rsfml;
55+
56+
use rsfml::system::vector2::Vector2f;
57+
use rsfml::window::context_settings::ContextSettings;
58+
use rsfml::window::video_mode::VideoMode;
59+
use rsfml::window::event;
60+
use rsfml::graphics::render_window::*;
61+
use rsfml::graphics::circle_shape::CircleShape;
62+
use rsfml::graphics::color::Color;
63+
64+
#[start]
65+
fn start(argc: int, argv: **u8, crate_map: *u8) -> int {
66+
std::rt::start_on_main_thread(argc, argv, crate_map, main)
67+
}
68+
5369
fn main () -> () {
5470
// Create the window of the application
5571
let setting = ContextSettings{
5672
depthBits: 10,
57-
stencilBits: 10,
58-
antialiasingLevel: 1,
59-
majorVersion: 0,
73+
stencilBits: 10,
74+
antialiasingLevel: 1,
75+
majorVersion: 0,
6076
minorVersion: 1
6177
};
62-
let mut window = match RenderWindow::new(VideoMode::new_init(800, 600, 32), ~"SFML Pong", sfClose, &setting) {
78+
let mut window = match RenderWindow::new(VideoMode::new_init(800, 600, 32), ~"SFML Example", sfClose, &setting) {
6379
Some(window) => window,
6480
None => fail!("Cannot create a new Render Window.")
6581
};
@@ -82,11 +98,11 @@ fn main () -> () {
8298
_ => {}
8399
}
84100
}
85-
101+
86102
// Clear the window
87103
window.clear(~Color::new_from_RGB(0, 200, 200));
88104
// Draw the shape
89-
window.draw(&circle);
105+
window.draw(&circle);
90106
// Display things on screen
91107
window.display()
92108
}

0 commit comments

Comments
 (0)