Skip to main content

choose_surface

Function choose_surface 

Source
pub fn choose_surface(
    caps: &SurfaceCapabilities,
    wanted: &DisplayTarget,
    policy: SurfacePolicy,
    headroom: f32,
) -> Option<(TextureFormat, SurfaceColorSpace, DisplayTarget)>
Expand description

The surface configuration path for a host that configures its own surface (eframe 0.36 configures 8-bit sRGB and offers no choice): the format and colour space to configure for wanted, among what the surface’s capabilities offer, and what the viewport will draw for once configured. Prefers what carries the wanted gamut and headroom, then fewer bits.