setup_surface

Function setup_surface 

Source
pub fn setup_surface(
    label: &str,
    size: (u32, u32),
    device: &Device,
    surface: &Surface<'_>,
    adapter: &Adapter,
    present_mode: PresentMode,
) -> SurfaceConfiguration
Expand description

Configure a surface for presentation once the window size is known.

Call this once at startup and again whenever you handle a resize event.

ยงExample

use wde_wgpu::instance::{setup_surface, PresentMode};

let config = setup_surface(label, size, device, surface, adapter, PresentMode::Fifo);
println!("configured swapchain {}x{}", config.width, config.height);