mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
Add resize example, fix warnings, make callback an option so it can be removed.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user