[][src]Trait iced_native::window::Backend

pub trait Backend: 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,
        output: &<Self::Renderer as Renderer>::Output,
        scale_factor: f64,
        overlay: &[T]
    ) -> MouseCursor; }

A graphics backend that can render 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 and an associated iced renderer.

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,
    output: &<Self::Renderer as Renderer>::Output,
    scale_factor: f64,
    overlay: &[T]
) -> MouseCursor

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

Loading content...

Implementors

Loading content...