MCPcopy Index your code
hub / github.com/endbasic/endbasic / requested_size_pixels

Function requested_size_pixels

sdl/src/host.rs:138–145  ·  view source on GitHub ↗

Returns the logical console size in pixels for explicit resolutions.

(resolution: Resolution)

Source from the content-addressed store, hash-verified

136
137/// Returns the logical console size in pixels for explicit resolutions.
138fn 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`.
148fn rgb_to_color(rgb: RGB) -> Color {

Calls 2

clamped_intoMethod · 0.80
getMethod · 0.45