Add resize example, fix warnings, make callback an option so it can be removed.

This commit is contained in:
Glenn Watson 2014-12-17 09:41:27 +10:00
parent 0ad9c3d453
commit fa5cb66cff
7 changed files with 27 additions and 23 deletions

View file

@ -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 main() {
let window = glutin::Window::new().unwrap();
window.set_title("A fantastic window!");
fn resize_callback(width: uint, height: uint) {
println!("Window resized to {}x{}", width, height);
}
#[cfg(feature = "window")]
fn main() {
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);