Trait Surface

Source
pub trait Surface {
    type CommandQueue: CommandQueue;
    type SwapChain: SwapChain;
    type Window;

    // Required methods
    fn from_window(window: &Self::Window) -> Self;
    fn build_swapchain<T: RenderFormat>(
        &self,
        present_queue: &Self::CommandQueue,
    ) -> Self::SwapChain;
}
Expand description

A Surface abstracts the surface of a native window, which will be presented

Required Associated Types§

Source

type CommandQueue: CommandQueue

Associated CommandQueue type.

Source

type SwapChain: SwapChain

Associated SwapChain type.

Source

type Window

Associated native Window type.

Required Methods§

Source

fn from_window(window: &Self::Window) -> Self

Create a new surface from a native window.

Source

fn build_swapchain<T: RenderFormat>( &self, present_queue: &Self::CommandQueue, ) -> Self::SwapChain

Create a new swapchain from the current surface with an associated present queue.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§