Struct vulkano::swapchain::Surface
[−]
[src]
pub struct Surface { /* fields omitted */ }
Represents a surface on the screen.
Creating a Surface
is platform-specific.
Methods
impl Surface
[src]
fn from_display_mode(
display_mode: &DisplayMode,
plane: &DisplayPlane
) -> Result<Arc<Surface>, SurfaceCreationError>
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
.
unsafe fn from_hwnd<T, U>(
instance: Arc<Instance>,
hinstance: *const T,
hwnd: *const U
) -> Result<Arc<Surface>, SurfaceCreationError>
instance: Arc<Instance>,
hinstance: *const T,
hwnd: *const U
) -> Result<Arc<Surface>, 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.
unsafe fn from_xcb<C>(
instance: Arc<Instance>,
connection: *const C,
window: u32
) -> Result<Arc<Surface>, SurfaceCreationError>
instance: Arc<Instance>,
connection: *const C,
window: u32
) -> Result<Arc<Surface>, 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.
unsafe fn from_xlib<D>(
instance: Arc<Instance>,
display: *const D,
window: c_ulong
) -> Result<Arc<Surface>, SurfaceCreationError>
instance: Arc<Instance>,
display: *const D,
window: c_ulong
) -> Result<Arc<Surface>, 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.
unsafe fn from_wayland<D, S>(
instance: Arc<Instance>,
display: *const D,
surface: *const S
) -> Result<Arc<Surface>, SurfaceCreationError>
instance: Arc<Instance>,
display: *const D,
surface: *const S
) -> Result<Arc<Surface>, 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.
unsafe fn from_mir<C, S>(
instance: Arc<Instance>,
connection: *const C,
surface: *const S
) -> Result<Arc<Surface>, SurfaceCreationError>
instance: Arc<Instance>,
connection: *const C,
surface: *const S
) -> Result<Arc<Surface>, SurfaceCreationError>
Creates a Surface
from a MIR window.
If the swapchain's dimensions does not match the window's dimensions, the image will automatically be scaled during presentation.
Safety
The caller must ensure that the connection
and the surface
are both correct and stay
alive for the entire lifetime of the surface.
unsafe fn from_anativewindow<T>(
instance: Arc<Instance>,
window: *const T
) -> Result<Arc<Surface>, SurfaceCreationError>
instance: Arc<Instance>,
window: *const T
) -> Result<Arc<Surface>, 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.
unsafe fn from_ios_moltenvk<T>(
instance: Arc<Instance>,
view: *const T
) -> Result<Arc<Surface>, SurfaceCreationError>
instance: Arc<Instance>,
view: *const T
) -> Result<Arc<Surface>, 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
UIView
must be backed by aCALayer
instance of typeCAMetalLayer
.
unsafe fn from_macos_moltenvk<T>(
instance: Arc<Instance>,
view: *const T
) -> Result<Arc<Surface>, SurfaceCreationError>
instance: Arc<Instance>,
view: *const T
) -> Result<Arc<Surface>, 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. - The
NSView
must be backed by aCALayer
instance of typeCAMetalLayer
.
unsafe fn from_vi_surface<T>(
instance: Arc<Instance>,
window: *const T
) -> Result<Arc<Surface>, SurfaceCreationError>
instance: Arc<Instance>,
window: *const T
) -> Result<Arc<Surface>, 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.
fn is_supported(&self, queue: QueueFamily) -> Result<bool, CapabilitiesError>
Returns true if the given queue family can draw on this surface.
fn get_capabilities(
&self,
device: &PhysicalDevice
) -> Result<Capabilities, OomError>
&self,
device: &PhysicalDevice
) -> Result<Capabilities, OomError>
fn capabilities(
&self,
device: PhysicalDevice
) -> Result<Capabilities, CapabilitiesError>
&self,
device: PhysicalDevice
) -> Result<Capabilities, CapabilitiesError>
Retreives 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.
fn instance(&self) -> &Arc<Instance>
Returns the instance this surface was created with.
Trait Implementations
impl VulkanObject for Surface
[src]
type Object = SurfaceKHR
The type of the object.
fn internal_object(&self) -> SurfaceKHR
Returns a reference to the object.
impl Debug for Surface
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.