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.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Surface
impl Send for Surface
impl Sync for Surface
impl Unpin for Surface
impl UnwindSafe for Surface
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.