diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2023-02-22 00:34:34 +0100 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2023-02-22 00:34:34 +0100 |
commit | ab77357480e4a46379d4b90f4a0cc372f3479ac2 (patch) | |
tree | 3d91756e1e5e330dc99b39952a03aedb00ce0ad0 | |
parent | SDL: Create simple testing window (diff) | |
download | kyukai-ab77357480e4a46379d4b90f4a0cc372f3479ac2.tar.gz kyukai-ab77357480e4a46379d4b90f4a0cc372f3479ac2.tar.bz2 kyukai-ab77357480e4a46379d4b90f4a0cc372f3479ac2.zip |
SDL: Wait and fetch events from the event pump
-rw-r--r-- | src/main.rs | 13 |
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!"); + } + } + } + } } |