pub(crate) trait DisplayModeTrait {
    // Required methods
    fn get_window_size(&self) -> (u32, u32);
    fn get_virtual_display_size(&self) -> (u32, u32);
    fn get_virtual_display_size_4k_uhd(
        &self,
        is_4k_uhd_enabled: bool
    ) -> (u32, u32);
}
Expand description

Trait that the platform-specific type DisplayMode needs to implement.

Required Methods§

source

fn get_window_size(&self) -> (u32, u32)

Returns the initial host window size.

source

fn get_virtual_display_size(&self) -> (u32, u32)

Returns the virtual display size used for creating the display device.

We need to query the phenotype flags to see if resolutions higher than 1080p should be enabled. This functions assumes process invariants have been set up and phenotype flags are available. If not, use get_virtual_display_size_4k_uhd() instead.

This may be different from the initial host window size since different display backends may have different alignment requirements on it.

source

fn get_virtual_display_size_4k_uhd(&self, is_4k_uhd_enabled: bool) -> (u32, u32)

Returns the virtual display size used for creating the display device.

While get_virtual_display_size() reads phenotype flags internally, this function does not, so it can be used when process invariants and phenotype flags are not yet ready.

Implementors§