[−][src]Struct vulkano::swapchain::Surface
Represents a surface on the screen.
Creating a Surface is platform-specific.
Methods
impl<W> Surface<W>[src]
pub unsafe fn from_raw_surface(
instance: Arc<Instance>,
surface: SurfaceKHR,
win: W
) -> Surface<W>[src]
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>[src]
display_mode: &DisplayMode,
plane: &DisplayPlane
) -> Result<Arc<Surface<()>>, SurfaceCreationError>
Creates a Surface that covers a display mode.
Panic
- Panics if
display_modeandplanedon't belong to the same physical device. - Panics if
planedoesn't support the display ofdisplay_mode.
pub unsafe fn from_hwnd<T, U>(
instance: Arc<Instance>,
hinstance: *const T,
hwnd: *const U,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>[src]
instance: Arc<Instance>,
hinstance: *const T,
hwnd: *const U,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
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.
pub unsafe fn from_xcb<C>(
instance: Arc<Instance>,
connection: *const C,
window: u32,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>[src]
instance: Arc<Instance>,
connection: *const C,
window: u32,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
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.
pub unsafe fn from_xlib<D>(
instance: Arc<Instance>,
display: *const D,
window: c_ulong,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>[src]
instance: Arc<Instance>,
display: *const D,
window: c_ulong,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>
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>[src]
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>[src]
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>[src]
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
viewis correct and stays alive for the entire lifetime of the surface. The win parameter can be used to ensure this. - The
UIViewmust be backed by aCALayerinstance of typeCAMetalLayer.
pub unsafe fn from_macos_moltenvk<T>(
instance: Arc<Instance>,
view: *const T,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>[src]
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
viewis correct and stays alive for the entire lifetime of the surface. Thewinparameter can be used to ensure this. - The
NSViewmust be backed by aCALayerinstance of typeCAMetalLayer.
pub unsafe fn from_vi_surface<T>(
instance: Arc<Instance>,
window: *const T,
win: W
) -> Result<Arc<Surface<W>>, SurfaceCreationError>[src]
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.
pub fn is_supported(
&self,
queue: QueueFamily
) -> Result<bool, CapabilitiesError>[src]
&self,
queue: QueueFamily
) -> Result<bool, CapabilitiesError>
Returns true if the given queue family can draw on this surface.
pub fn capabilities(
&self,
device: PhysicalDevice
) -> Result<Capabilities, CapabilitiesError>[src]
&self,
device: PhysicalDevice
) -> Result<Capabilities, CapabilitiesError>
Retrieves the capabilities of a surface when used by a certain device.
Panic
- Panics if the device and the surface don't belong to the same instance.
pub fn window(&self) -> &W[src]
pub fn instance(&self) -> &Arc<Instance>[src]
Returns the instance this surface was created with.
Trait Implementations
impl<W> VulkanObject for Surface<W>[src]
type Object = SurfaceKHR
The type of the object.
const TYPE: DebugReportObjectTypeEXT[src]
fn internal_object(&self) -> SurfaceKHR[src]
impl<W> Drop for Surface<W>[src]
impl<W> Debug for Surface<W>[src]
Auto Trait Implementations
impl<W> Send for Surface<W> where
W: Send,
W: Send,
impl<W> Unpin for Surface<W> where
W: Unpin,
W: Unpin,
impl<W> Sync for Surface<W> where
W: Sync,
W: Sync,
impl<W> UnwindSafe for Surface<W> where
W: UnwindSafe,
W: UnwindSafe,
impl<W> RefUnwindSafe for Surface<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
Blanket Implementations
impl<T> Content for T[src]
fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>[src]
fn is_size_suitable(usize) -> bool[src]
fn indiv_size() -> usize[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,