From 5dda16702164d59a75d8c36373cf29a8d7f4d58f Mon Sep 17 00:00:00 2001 From: Tomaka17 Date: Sat, 2 Aug 2014 08:24:30 +0200 Subject: Add iterators for events and WindowBuilder --- examples/fullscreen.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'examples/fullscreen.rs') diff --git a/examples/fullscreen.rs b/examples/fullscreen.rs index b6141a0..80e6089 100644 --- a/examples/fullscreen.rs +++ b/examples/fullscreen.rs @@ -5,8 +5,6 @@ extern crate gl; use std::io::stdio::stdin; fn main() { - use std::default::Default; - // enumerating monitors let monitor = { for (num, monitor) in init::get_available_monitors().enumerate() { @@ -23,8 +21,11 @@ fn main() { monitor }; - let window = init::Window::new(None, "Hello world!", &Default::default(), - Some(monitor)).unwrap(); + let window = init::WindowBuilder::new() + .with_title("Hello world!".to_string()) + .with_monitor(monitor) + .build() + .unwrap(); unsafe { window.make_current() }; @@ -40,7 +41,7 @@ fn main() { gl::ClearColor(0.0, 1.0, 0.0, 1.0); while !window.is_closed() { - println!("{}", window.wait_events()); + println!("{}", window.wait_events().collect::>()); gl::Clear(gl::COLOR_BUFFER_BIT); -- cgit v1.2.3