From d53ad7eb43c7d25b321a5453a480804be28f9f1a Mon Sep 17 00:00:00 2001 From: Imbris Date: Sat, 18 Jul 2020 08:17:42 -0400 Subject: [PATCH] Fix color depth selection --- voxygen/src/window.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index c50dad3496..156b4ebcbd 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -1049,8 +1049,16 @@ impl Window { window .current_monitor() .video_modes() + .filter(|mode| mode.bit_depth() >= 24) .max_by_key(|mode| mode.size().width) - .expect("No video modes available!!"), + .unwrap_or_else(|| { + warn!("No video mode with a bit depth of at least 24 found"); + window + .current_monitor() + .video_modes() + .max_by_key(|mode| mode.size().width) + .expect("No video modes available!!") + }), ))); } else { window.set_fullscreen(None);