mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 21:30:03 -04:00
Add iterators for events and WindowBuilder
This commit is contained in:
@@ -3,9 +3,7 @@ extern crate libc;
|
||||
extern crate gl;
|
||||
|
||||
fn main() {
|
||||
use std::default::Default;
|
||||
|
||||
let window = init::Window::new(None, "Hello world!", &Default::default(), None).unwrap();
|
||||
let window = init::Window::new().unwrap();
|
||||
|
||||
unsafe { window.make_current() };
|
||||
|
||||
@@ -21,7 +19,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::<Vec<init::Event>>());
|
||||
|
||||
gl::Clear(gl::COLOR_BUFFER_BIT);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user