Mark the current display modes
authorTomas Wenström <tomas.wenstrom@gmail.com>
Wed, 6 Jan 2021 12:58:50 +0000 (13:58 +0100)
committerTomas Wenström <tomas.wenstrom@gmail.com>
Wed, 6 Jan 2021 12:58:50 +0000 (13:58 +0100)
src/game/app.rs

index 3e11b5d..88f8e88 100644 (file)
@@ -107,15 +107,18 @@ impl AppBuilder {
                 " desktop_display_mode: {:?}",
                 video.desktop_display_mode(display).unwrap()
             );
+           let current = video.current_display_mode(display).unwrap();
             println!(
                 " current_display_mode: {:?}",
-                video.current_display_mode(display).unwrap()
+                current
             );
-            for mode in 0..video.num_display_modes(display).unwrap() {
+            for idx in 0..video.num_display_modes(display).unwrap() {
+               let mode = video.display_mode(display, idx).unwrap();
                 println!(
-                    "  {:2}: {:?}",
-                    mode,
-                    video.display_mode(display, mode).unwrap()
+                    " {}{:2}: {:?}",
+                   if mode == current { "*" } else { " " },
+                    idx,
+                    mode
                 );
             }
         }