aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-04-02 22:04:17 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-04-02 22:41:35 +0200
commitd33c138164d069f025439f97920771f1f8c7775e (patch)
treed54b6953a9540d3b9e93c7a76ac48814be8c9773 /examples
parent2e1fe8283f82208375737674a731d2fe3c5e4539 (diff)
downloadglutin-d33c138164d069f025439f97920771f1f8c7775e.tar.gz
glutin-d33c138164d069f025439f97920771f1f8c7775e.zip
Rustup
Diffstat (limited to 'examples')
-rw-r--r--examples/multiwindow.rs8
-rw-r--r--examples/support/mod.rs5
2 files changed, 7 insertions, 6 deletions
diff --git a/examples/multiwindow.rs b/examples/multiwindow.rs
index a7680b8..9256555 100644
--- a/examples/multiwindow.rs
+++ b/examples/multiwindow.rs
@@ -6,7 +6,7 @@ extern crate android_glue;
extern crate glutin;
-use std::thread::Thread;
+use std::thread;
mod support;
@@ -22,15 +22,15 @@ fn main() {
let window2 = glutin::Window::new().unwrap();
let window3 = glutin::Window::new().unwrap();
- let t1 = Thread::scoped(move || {
+ let t1 = thread::scoped(move || {
run(window1, (0.0, 1.0, 0.0, 1.0));
});
- let t2 = Thread::scoped(move || {
+ let t2 = thread::scoped(move || {
run(window2, (0.0, 0.0, 1.0, 1.0));
});
- let t3 = Thread::scoped(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 94ef1a7..329bd4b 100644
--- a/examples/support/mod.rs
+++ b/examples/support/mod.rs
@@ -1,5 +1,6 @@
#![cfg(feature = "window")]
+use std::ffi::CStr;
use glutin;
#[cfg(not(target_os = "android"))]
@@ -21,8 +22,8 @@ pub fn load(window: &glutin::Window) -> Context {
let gl = gl::Gl::load(window);
let version = unsafe {
- use std::ffi;
- String::from_utf8(ffi::c_str_to_bytes(&(gl.GetString(gl::VERSION) as *const i8)).to_vec()).unwrap()
+ let data = CStr::from_ptr(gl.GetString(gl::VERSION) as *const i8).to_bytes().to_vec();
+ String::from_utf8(data).unwrap()
};
println!("OpenGL version {}", version);