From 66f6b003d02dc83824725d4aaec0e4a1b4f0968b Mon Sep 17 00:00:00 2001 From: Tomaka17 Date: Wed, 30 Jul 2014 13:05:58 +0200 Subject: The example now prints OpenGL version --- examples/window.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/window.rs b/examples/window.rs index 5d12c59..39dd014 100644 --- a/examples/window.rs +++ b/examples/window.rs @@ -11,11 +11,20 @@ fn main() { gl::load_with(|symbol| window.get_proc_address(symbol) as *const libc::c_void); + let version = { + use std::c_str::CString; + unsafe { CString::new(gl::GetString(gl::VERSION) as *const i8, false) } + }; + + println!("OpenGL version {}", version.as_str().unwrap()); + gl::ClearColor(0.0, 1.0, 0.0, 1.0); while !window.should_close() { println!("{}", window.wait_events()); + println!("pos: {}", window.get_position()); + gl::Clear(gl::COLOR_BUFFER_BIT); window.swap_buffers(); -- cgit v1.2.3