aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2014-12-18 20:51:48 +0100
committertomaka <pierre.krieger1708@gmail.com>2014-12-18 20:51:48 +0100
commit70f9f8cf43e51cdd90e1a0163c40cfa617b9f511 (patch)
treee897dc26beb5faf7c75c127c813953d8407abc75 /examples
parent0164449955d1b4787fce03f8800e32f19fd04a01 (diff)
parentf2d112213ba889eddb6c1b0fab878bcd4f500c64 (diff)
downloadglutin-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.rs9
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);