[][src]Trait iced_graphics::window::Compositor

pub trait Compositor: Sized {
    type Settings: Default;
    type Renderer: Renderer;
    type Surface;
    type SwapChain;
    fn new(settings: Self::Settings) -> (Self, Self::Renderer);
fn create_surface<W: HasRawWindowHandle>(
        &mut self,
        window: &W
    ) -> Self::Surface;
fn create_swap_chain(
        &mut self,
        surface: &Self::Surface,
        width: u32,
        height: u32
    ) -> Self::SwapChain;
fn draw<T: AsRef<str>>(
        &mut self,
        renderer: &mut Self::Renderer,
        swap_chain: &mut Self::SwapChain,
        viewport: &Viewport,
        background_color: Color,
        output: &<Self::Renderer as Renderer>::Output,
        overlay: &[T]
    ) -> Interaction; }

A graphics compositor that can draw to windows.

Associated Types

type Settings: Default

The settings of the backend.

type Renderer: Renderer

The iced renderer of the backend.

type Surface

The surface of the backend.

type SwapChain

The swap chain of the backend.

Loading content...

Required methods

fn new(settings: Self::Settings) -> (Self, Self::Renderer)

Creates a new Backend.

fn create_surface<W: HasRawWindowHandle>(&mut self, window: &W) -> Self::Surface

Crates a new Surface for the given window.

fn create_swap_chain(
    &mut self,
    surface: &Self::Surface,
    width: u32,
    height: u32
) -> Self::SwapChain

Crates a new SwapChain for the given Surface.

fn draw<T: AsRef<str>>(
    &mut self,
    renderer: &mut Self::Renderer,
    swap_chain: &mut Self::SwapChain,
    viewport: &Viewport,
    background_color: Color,
    output: &<Self::Renderer as Renderer>::Output,
    overlay: &[T]
) -> Interaction

Draws the output primitives to the next frame of the given SwapChain.

Loading content...

Implementors

Loading content...