aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 7 insertions, 5 deletions
diff --git a/README.md b/README.md
index 935e110..9ca5757 100644
--- a/README.md
+++ b/README.md
@@ -34,9 +34,9 @@ libc = "*"
```
```rust
+extern crate gl;
extern crate glutin;
extern crate libc;
-extern crate gl;
fn main() {
let window = glutin::Window::new().unwrap();
@@ -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,
+ _ => ()
+ }
}
}
```