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§
Sourcetype CommandQueue: CommandQueue
type CommandQueue: CommandQueue
Associated CommandQueue type.
Required Methods§
Sourcefn from_window(window: &Self::Window) -> Self
fn from_window(window: &Self::Window) -> Self
Create a new surface from a native window.
Sourcefn build_swapchain<T: RenderFormat>(
&self,
present_queue: &Self::CommandQueue,
) -> Self::SwapChain
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.