pub trait Surface<B: Backend>:
Debug
+ Any
+ Send
+ Sync {
// Required methods
fn supports_queue_family(&self, family: &B::QueueFamily) -> bool;
fn capabilities(
&self,
physical_device: &B::PhysicalDevice,
) -> SurfaceCapabilities;
fn supported_formats(
&self,
physical_device: &B::PhysicalDevice,
) -> Option<Vec<Format>>;
}
Expand description
A Surface
abstracts the surface of a native window.
Required Methods§
Sourcefn supports_queue_family(&self, family: &B::QueueFamily) -> bool
fn supports_queue_family(&self, family: &B::QueueFamily) -> bool
Check if the queue family supports presentation to this surface.
Sourcefn capabilities(
&self,
physical_device: &B::PhysicalDevice,
) -> SurfaceCapabilities
fn capabilities( &self, physical_device: &B::PhysicalDevice, ) -> SurfaceCapabilities
Query surface capabilities for this physical device.
Use this function for configuring swapchain creation.
Sourcefn supported_formats(
&self,
physical_device: &B::PhysicalDevice,
) -> Option<Vec<Format>>
fn supported_formats( &self, physical_device: &B::PhysicalDevice, ) -> Option<Vec<Format>>
Query surface formats for this physical device.
This function may be slow. It’s typically used during the initialization only.
Note: technically the surface support formats may change at the point where an application needs to recreate the swapchain, e.g. when the window is moved to a different monitor.
If None
is returned then the surface has no preferred format and the
application may use any desired format.