Returns the logical console size in pixels for explicit resolutions.
(resolution: Resolution)
| 136 | |
| 137 | /// Returns the logical console size in pixels for explicit resolutions. |
| 138 | fn requested_size_pixels(resolution: Resolution) -> Option<SizeInPixels> { |
| 139 | match resolution { |
| 140 | Resolution::FullScreen(size) | Resolution::Windowed(size) => { |
| 141 | Some(SizeInPixels::new(size.0.get().clamped_into(), size.1.get().clamped_into())) |
| 142 | } |
| 143 | Resolution::FullScreenDesktop => None, |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | /// Converts our own `RGB` type to an SDL `Color`. |
| 148 | fn rgb_to_color(rgb: RGB) -> Color { |