Struct vulkano::swapchain::Surface [−][src]
pub struct Surface<W> { /* fields omitted */ }
Expand description
Represents a surface on the screen.
Creating a Surface
is platform-specific.
Implementations
pub unsafe fn from_raw_surface(
instance: Arc<Instance>,
surface: SurfaceKHR,
win: W
) -> Surface<W>
pub unsafe fn from_raw_surface(
instance: Arc<Instance>,
surface: SurfaceKHR,
win: W
) -> Surface<W>
Creates a Surface
given the raw handler.
Be careful when using it
pub fn from_display_mode(
display_mode: &DisplayMode,
plane: &DisplayPlane
) -> Result<Arc<Surface<()>>, SurfaceCreationError>
pub fn from_display_mode(
display_mode: &DisplayMode,
plane: &DisplayPlane
) -> Result<Arc<Surface<()>>, SurfaceCreationError>
Creates a Surface
that covers a display mode.
Panic
- Panics if
display_mode
andplane
don’t belong to the same physical device. - Panics if
plane
doesn’t support the display ofdisplay_mode
.
Creates a Surface
from a Win32 window.
The surface’s min, max and current extent will always match the window’s dimensions.
Safety
The caller must ensure that the hinstance
and the hwnd
are both correct and stay
alive for the entire lifetime of the surface. The win
parameter can be used to ensure this.
Creates a Surface
from an XCB window.
The surface’s min, max and current extent will always match the window’s dimensions.
Safety
The caller must ensure that the connection
and the window
are both correct and stay
alive for the entire lifetime of the surface. The win
parameter can be used to ensure this.
Creates a Surface
from an Xlib window.
The surface’s min, max and current extent will always match the window’s dimensions.
Safety
The caller must ensure that the display
and the window
are both correct and stay
alive for the entire lifetime of the surface. The win
parameter can be used to ensure this.
pub unsafe fn from_wayland<D, S>(
instance: Arc<Instance>,
display: *const D,
surface: *const S,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
pub unsafe fn from_wayland<D, S>(
instance: Arc<Instance>,
display: *const D,
surface: *const S,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
Creates a Surface
from a Wayland window.
The window’s dimensions will be set to the size of the swapchain.
Safety
The caller must ensure that the display
and the surface
are both correct and stay
alive for the entire lifetime of the surface. The win
parameter can be used to ensure this.
pub unsafe fn from_anativewindow<T>(
instance: Arc<Instance>,
window: *const T,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
pub unsafe fn from_anativewindow<T>(
instance: Arc<Instance>,
window: *const T,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
Creates a Surface
from an Android window.
Safety
The caller must ensure that the window
is correct and stays alive for the entire
lifetime of the surface. The win
parameter can be used to ensure this.
pub unsafe fn from_ios_moltenvk<T>(
instance: Arc<Instance>,
view: *const T,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
pub unsafe fn from_ios_moltenvk<T>(
instance: Arc<Instance>,
view: *const T,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
Creates a Surface
from an iOS UIView
.
Safety
- The caller must ensure that the
view
is correct and stays alive for the entire lifetime of the surface. The win parameter can be used to ensure this. - The
UIView
must be backed by aCALayer
instance of typeCAMetalLayer
.
pub unsafe fn from_macos_moltenvk<T>(
instance: Arc<Instance>,
view: *const T,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
pub unsafe fn from_macos_moltenvk<T>(
instance: Arc<Instance>,
view: *const T,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
Creates a Surface
from a MacOS NSView
.
Safety
- The caller must ensure that the
view
is correct and stays alive for the entire lifetime of the surface. Thewin
parameter can be used to ensure this. - The
NSView
must be backed by aCALayer
instance of typeCAMetalLayer
.
pub unsafe fn from_metal_layer<T>(
instance: Arc<Instance>,
layer: *const T,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
pub unsafe fn from_metal_layer<T>(
instance: Arc<Instance>,
layer: *const T,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
Creates a Surface
from a CAMetalLayer
.
Safety
- The caller must ensure that the
layer
is correct and stays alive for the entire lifetime of the surface. Thewin
parameter can be used to ensure this.
pub unsafe fn from_vi_surface<T>(
instance: Arc<Instance>,
window: *const T,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
pub unsafe fn from_vi_surface<T>(
instance: Arc<Instance>,
window: *const T,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
Creates a Surface
from a code:nn::code:vi::code:Layer
.
Safety
The caller must ensure that the window
is correct and stays alive for the entire
lifetime of the surface. The win
parameter can be used to ensure this.
Returns true if the given queue family can draw on this surface.
pub fn capabilities(
&self,
device: PhysicalDevice<'_>
) -> Result<Capabilities, CapabilitiesError>
pub fn capabilities(
&self,
device: PhysicalDevice<'_>
) -> Result<Capabilities, CapabilitiesError>
Trait Implementations
Auto Trait Implementations
impl<W> RefUnwindSafe for Surface<W> where
W: RefUnwindSafe,
impl<W> UnwindSafe for Surface<W> where
W: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Builds a pointer to this type from a raw pointer.
Returns true if the size is suitable to store a type like this.
Returns the size of an individual element.