diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/window.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/window.rs b/examples/window.rs index e947234..dce8f3a 100644 --- a/examples/window.rs +++ b/examples/window.rs @@ -15,10 +15,15 @@ android_start!(main) fn main() { println!("This example requires glutin to be compiled with the `window` feature"); } #[cfg(feature = "window")] +fn resize_callback(width: uint, height: uint) { + println!("Window resized to {}x{}", width, height); +} + +#[cfg(feature = "window")] fn main() { - let window = glutin::Window::new().unwrap(); + let mut window = glutin::Window::new().unwrap(); window.set_title("A fantastic window!"); - + window.set_window_resize_callback(Some(resize_callback)); unsafe { window.make_current() }; let context = support::load(&window); |