aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-01-09 23:06:14 +0100
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-01-10 08:23:20 +0100
commit469d0eafd1704d5e9a172adfc673708fc76923e9 (patch)
treeeb5d69fa2deb0326a4dc43bddb1f4ff6be8c4051 /examples
parent9d7dbf7eb039d5614976a184082163bc97a319c6 (diff)
downloadglutin-469d0eafd1704d5e9a172adfc673708fc76923e9.tar.gz
glutin-469d0eafd1704d5e9a172adfc673708fc76923e9.zip
Update for rust alpha 1.0
Diffstat (limited to 'examples')
-rw-r--r--examples/fullscreen.rs6
-rw-r--r--examples/multiwindow.rs6
-rw-r--r--examples/support/mod.rs2
-rw-r--r--examples/window.rs2
4 files changed, 8 insertions, 8 deletions
diff --git a/examples/fullscreen.rs b/examples/fullscreen.rs
index c77569f..7c2ece8 100644
--- a/examples/fullscreen.rs
+++ b/examples/fullscreen.rs
@@ -19,7 +19,7 @@ fn main() {
// enumerating monitors
let monitor = {
for (num, monitor) in glutin::get_available_monitors().enumerate() {
- println!("Monitor #{}: {}", num, monitor.get_name());
+ println!("Monitor #{}: {:?}", num, monitor.get_name());
}
print!("Please write the number of the monitor to use: ");
@@ -27,7 +27,7 @@ fn main() {
.expect("Plase enter a number");
let monitor = glutin::get_available_monitors().nth(num).expect("Please enter a valid ID");
- println!("Using {}", monitor.get_name());
+ println!("Using {:?}", monitor.get_name());
monitor
};
@@ -47,6 +47,6 @@ fn main() {
context.draw_frame((0.0, 1.0, 0.0, 1.0));
window.swap_buffers();
- println!("{}", window.wait_events().collect::<Vec<glutin::Event>>());
+ println!("{:?}", window.wait_events().collect::<Vec<glutin::Event>>());
}
}
diff --git a/examples/multiwindow.rs b/examples/multiwindow.rs
index fc01ef0..96b5842 100644
--- a/examples/multiwindow.rs
+++ b/examples/multiwindow.rs
@@ -20,15 +20,15 @@ fn main() {
let window2 = glutin::Window::new().unwrap();
let window3 = glutin::Window::new().unwrap();
- let t1 = Thread::spawn(move || {
+ let t1 = Thread::scoped(move || {
run(window1, (0.0, 1.0, 0.0, 1.0));
});
- let t2 = Thread::spawn(move || {
+ let t2 = Thread::scoped(move || {
run(window2, (0.0, 0.0, 1.0, 1.0));
});
- let t3 = Thread::spawn(move || {
+ let t3 = Thread::scoped(move || {
run(window3, (1.0, 0.0, 0.0, 1.0));
});
diff --git a/examples/support/mod.rs b/examples/support/mod.rs
index 7144952..94ef1a7 100644
--- a/examples/support/mod.rs
+++ b/examples/support/mod.rs
@@ -22,7 +22,7 @@ pub fn load(window: &glutin::Window) -> Context {
let version = unsafe {
use std::ffi;
- ffi::c_str_to_bytes(&(gl.GetString(gl::VERSION) as *const i8)).to_string()
+ String::from_utf8(ffi::c_str_to_bytes(&(gl.GetString(gl::VERSION) as *const i8)).to_vec()).unwrap()
};
println!("OpenGL version {}", version);
diff --git a/examples/window.rs b/examples/window.rs
index 9cb59c8..11ab737 100644
--- a/examples/window.rs
+++ b/examples/window.rs
@@ -30,6 +30,6 @@ fn main() {
context.draw_frame((0.0, 1.0, 0.0, 1.0));
window.swap_buffers();
- println!("{}", window.wait_events().collect::<Vec<glutin::Event>>());
+ println!("{:?}", window.wait_events().collect::<Vec<glutin::Event>>());
}
}