Add resize example, fix warnings, make callback an option so it can be removed.
This commit is contained in:
parent
0ad9c3d453
commit
fa5cb66cff
7 changed files with 27 additions and 23 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue