pub struct Surface { /* private fields */ }Expand description
Smart pointer handle to a vk::SurfaceKHR object.
Implementations§
Source§impl Surface
impl Surface
Sourcepub fn capabilities(this: &Self) -> Result<SurfaceCapabilitiesKHR, DriverError>
pub fn capabilities(this: &Self) -> Result<SurfaceCapabilitiesKHR, DriverError>
Query surface capabilities
Sourcepub fn create(
device: &Arc<Device>,
window: &(impl HasDisplayHandle + HasWindowHandle),
) -> Result<Self, DriverError>
pub fn create( device: &Arc<Device>, window: &(impl HasDisplayHandle + HasWindowHandle), ) -> 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 present_modes(this: &Self) -> Result<Vec<PresentModeKHR>, DriverError>
pub fn present_modes(this: &Self) -> Result<Vec<PresentModeKHR>, DriverError>
Query supported presentation modes.
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.