diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -49,12 +49,14 @@ fn main() { gl::ClearColor(0.0, 1.0, 0.0, 1.0); } - while !window.is_closed() { - window.wait_events(); - + for event in window.wait_events() { unsafe { gl::Clear(gl::COLOR_BUFFER_BIT) }; - window.swap_buffers(); + + match event { + glutin::Event::Closed => break, + _ => () + } } } ``` |