pub struct Surface { /* private fields */ }
Expand description
Smart pointer handle to a vk::SurfaceKHR
object.
Implementations§
source§impl Surface
impl Surface
sourcepub fn create(
device: &Arc<Device>,
display_window: &(impl HasRawDisplayHandle + HasRawWindowHandle)
) -> Result<Self, DriverError>
pub fn create( device: &Arc<Device>, display_window: &(impl HasRawDisplayHandle + HasRawWindowHandle) ) -> Result<Self, DriverError>
Create a surface from a raw window display handle.
device
must have been created with platform specific surface extensions enabled, acquired
through Device::create_display_window
.
sourcepub fn formats(this: &Self) -> Result<Vec<SurfaceFormatKHR>, DriverError>
pub fn formats(this: &Self) -> Result<Vec<SurfaceFormatKHR>, DriverError>
Lists the supported surface formats.
sourcepub fn linear(formats: &[SurfaceFormatKHR]) -> Option<SurfaceFormatKHR>
pub fn linear(formats: &[SurfaceFormatKHR]) -> Option<SurfaceFormatKHR>
Helper function to automatically select the best UNORM format, if one is available.
sourcepub fn linear_or_default(formats: &[SurfaceFormatKHR]) -> SurfaceFormatKHR
pub fn linear_or_default(formats: &[SurfaceFormatKHR]) -> SurfaceFormatKHR
Helper function to automatically select the best UNORM format.
NOTE: The default surface format is undefined, and although legal the results may
not support presentation. You should prefer to use Surface::linear
and fall back to
supported values manually.
sourcepub fn srgb(formats: &[SurfaceFormatKHR]) -> Option<SurfaceFormatKHR>
pub fn srgb(formats: &[SurfaceFormatKHR]) -> Option<SurfaceFormatKHR>
Helper function to automatically select the best sRGB format, if one is available.
sourcepub fn srgb_or_default(formats: &[SurfaceFormatKHR]) -> SurfaceFormatKHR
pub fn srgb_or_default(formats: &[SurfaceFormatKHR]) -> SurfaceFormatKHR
Helper function to automatically select the best sRGB format.
NOTE: The default surface format is undefined, and although legal the results may
not support presentation. You should prefer to use Surface::srgb
and fall back to
supported values manually.