From dbdb43f077f4fa016e9f3f65345c4a947eceaa77 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 8 Jan 2015 09:28:22 +0100 Subject: Update for Rustc --- examples/support/mod.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'examples/support') diff --git a/examples/support/mod.rs b/examples/support/mod.rs index 42ce6a4..7144952 100644 --- a/examples/support/mod.rs +++ b/examples/support/mod.rs @@ -1,8 +1,5 @@ #![cfg(feature = "window")] -#[phase(plugin)] -extern crate gl_generator; - use glutin; #[cfg(not(target_os = "android"))] @@ -23,12 +20,12 @@ pub struct Context { pub fn load(window: &glutin::Window) -> Context { let gl = gl::Gl::load(window); - let version = { - use std::c_str::CString; - unsafe { CString::new(gl.GetString(gl::VERSION) as *const i8, false) } + let version = unsafe { + use std::ffi; + ffi::c_str_to_bytes(&(gl.GetString(gl::VERSION) as *const i8)).to_string() }; - println!("OpenGL version {}", version.as_str().unwrap()); + println!("OpenGL version {}", version); Context { gl: gl } } -- cgit v1.2.3