winit-sonoma-fix/examples/video_modes.rs

23 lines
517 B
Rust
Raw Normal View History

2022-06-10 20:43:33 +10:00
#![allow(clippy::single_match)]
use simple_logger::SimpleLogger;
use winit::event_loop::EventLoop;
fn main() {
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let monitor = match event_loop.primary_monitor() {
Some(monitor) => monitor,
None => {
println!("No primary monitor detected.");
return;
}
};
println!("Listing available video modes:");
for mode in monitor.video_modes() {
2023-01-27 15:18:58 +11:00
println!("{mode}");
}
}