From ab77357480e4a46379d4b90f4a0cc372f3479ac2 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Wed, 22 Feb 2023 00:34:34 +0100 Subject: SDL: Wait and fetch events from the event pump --- src/main.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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!"); + } + } + } + } } -- cgit 1.4.1