about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2023-02-22 00:34:34 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2023-02-22 00:34:34 +0100
commitab77357480e4a46379d4b90f4a0cc372f3479ac2 (patch)
tree3d91756e1e5e330dc99b39952a03aedb00ce0ad0
parentSDL: Create simple testing window (diff)
downloadkyukai-ab77357480e4a46379d4b90f4a0cc372f3479ac2.tar.gz
kyukai-ab77357480e4a46379d4b90f4a0cc372f3479ac2.tar.bz2
kyukai-ab77357480e4a46379d4b90f4a0cc372f3479ac2.zip
SDL: Wait and fetch events from the event pump
-rw-r--r--src/main.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index f589070..218ef96 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -21,5 +21,16 @@ pub fn main() {
     canvas.clear();
     canvas.present();
 
-    loop {}
+    let mut sdl_event_pump = sdl_context
+        .event_pump()
+        .expect("Couldn't get the SDL2 event pump!");
+    loop {
+        for event in sdl_event_pump.wait_iter() {
+            match event {
+                _ => {
+                    println!("Event!");
+                }
+            }
+        }
+    }
 }