Automatic fullscreen when starting from steam (#289)

This commit is contained in:
Philip Kristoffersen
2022-12-28 12:20:43 +01:00
committed by GitHub
parent 32c65408a7
commit 78cfd96f37
4 changed files with 19 additions and 4 deletions
+9 -1
View File
@@ -353,7 +353,7 @@ pub fn run_sync() {
pub fn run_ui(args: Vec<String>) {
let app = MyEguiApp::new();
let no_v_sync = args.contains(&"--no-vsync".to_string());
let fullscreen = args.contains(&"--fullscreen".to_string());
let fullscreen = is_fullscreen(&args);
let native_options = eframe::NativeOptions {
fullscreen,
maximized: true,
@@ -371,3 +371,11 @@ pub fn run_ui(args: Vec<String>) {
}),
);
}
fn is_fullscreen(args: &Vec<String>) -> bool {
let is_steam_mode = match std::env::var("SteamAppId") {
Ok(value) => !value.is_empty(),
Err(_) => false,
};
is_steam_mode || args.contains(&"--fullscreen".to_string())
}