diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2014-12-17 09:41:27 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2014-12-19 05:44:47 +1000 |
commit | fa5cb66cff2e13a5ee75c4f99abe5f93bede7dd1 (patch) | |
tree | d43f94a82c811600935ec4fe5848499f63c80357 /examples | |
parent | 0ad9c3d453076adc5d94008d7e155d7ee5536225 (diff) | |
download | glutin-fa5cb66cff2e13a5ee75c4f99abe5f93bede7dd1.tar.gz glutin-fa5cb66cff2e13a5ee75c4f99abe5f93bede7dd1.zip |
Add resize example, fix warnings, make callback an option so it can be removed.
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); |