diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2014-12-18 20:51:48 +0100 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2014-12-18 20:51:48 +0100 |
commit | 70f9f8cf43e51cdd90e1a0163c40cfa617b9f511 (patch) | |
tree | e897dc26beb5faf7c75c127c813953d8407abc75 /examples | |
parent | 0164449955d1b4787fce03f8800e32f19fd04a01 (diff) | |
parent | f2d112213ba889eddb6c1b0fab878bcd4f500c64 (diff) | |
download | glutin-70f9f8cf43e51cdd90e1a0163c40cfa617b9f511.tar.gz glutin-70f9f8cf43e51cdd90e1a0163c40cfa617b9f511.zip |
Merge pull request #160 from glennw/mac-resize
Add callback function to allow resize messages to be sent on mac.
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); |