From b8edcda33f5c305a5e48f84ed5880bd720f6dfc0 Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Mon, 9 Nov 2020 22:02:35 +0100 Subject: Remove instant exit key in favour of OS-keys --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 11cdcfe..a0d8a13 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,6 +19,7 @@ pub const CONFIG_FILE: &str = "config.ron"; fn main() { let (mut rl, thread) = raylib::init().resizable().title("Hello there!").build(); rl.set_target_fps(120); + rl.set_exit_key(None); // Load the configuration file, if available. let config = match Config::from_file(CONFIG_FILE) { @@ -30,7 +31,9 @@ fn main() { let config = Config::default(); if err.kind() == io::ErrorKind::NotFound { println!("Could not find a configuration file. Creating default."); - config.write_file(CONFIG_FILE); + config + .write_file(CONFIG_FILE) + .expect("Could not write config file."); } else { println!("Could not read configuration file: {}", err); println!("Using defaults for this run."); -- cgit v1.2.3-70-g09d2