Trait draw2d::graphics::vulkan::window_surface::WindowSurface [−][src]
pub trait WindowSurface { fn clone_vulkan_instance(&self) -> Arc<Instance>; fn framebuffer_size(&self) -> (u32, u32); unsafe fn get_surface_handle(&self) -> SurfaceKHR; unsafe fn get_physical_device_surface_support(
&self,
physical_device: &PhysicalDevice,
queue_family_index: u32
) -> Result<bool>; unsafe fn supported_formats(
&self,
physical_device: &PhysicalDevice
) -> Vec<SurfaceFormatKHR>; unsafe fn supported_presentation_modes(
&self,
physical_device: &PhysicalDevice
) -> Vec<PresentModeKHR>; unsafe fn surface_capabilities(
&self,
physical_device: &PhysicalDevice
) -> Result<SurfaceCapabilitiesKHR>; }
Expand description
The WindowSurface trait defines what other parts of the application require of a window + Vulkan Surface pair.
Required methods
fn clone_vulkan_instance(&self) -> Arc<Instance>
fn clone_vulkan_instance(&self) -> Arc<Instance>
clone the instance created by this window surface
Yield the window’s current framebuffer size.
The size is in physical pixels and is meant to be used directly in the swapchain extent.
unsafe fn get_surface_handle(&self) -> SurfaceKHR
unsafe fn get_surface_handle(&self) -> SurfaceKHR
Get the raw surface handle.
Unsafe because the the WindowSurface itself is responsible for the lifetime of the real surface object. The caller should not retain this handle except for the creation of other vulkan resources which will not outlive the window surface.
unsafe fn get_physical_device_surface_support(
&self,
physical_device: &PhysicalDevice,
queue_family_index: u32
) -> Result<bool>
unsafe fn get_physical_device_surface_support(
&self,
physical_device: &PhysicalDevice,
queue_family_index: u32
) -> Result<bool>
Check that a physical device supports rendering to this surface.
Unsafe because the device’s supported extensions must be checked prior to querying for queue presentation support.
unsafe fn supported_formats(
&self,
physical_device: &PhysicalDevice
) -> Vec<SurfaceFormatKHR>
unsafe fn supported_formats(
&self,
physical_device: &PhysicalDevice
) -> Vec<SurfaceFormatKHR>
Fetch the supported formats for this device.
Unsafe because the device’s supported extensions must be checked prior to querying the surface formats.
unsafe fn supported_presentation_modes(
&self,
physical_device: &PhysicalDevice
) -> Vec<PresentModeKHR>
unsafe fn supported_presentation_modes(
&self,
physical_device: &PhysicalDevice
) -> Vec<PresentModeKHR>
Fetch the supported presentation modes for this device.
Unsafe because the device’s supported extensions must be checked prior to querying the presentation modes.
unsafe fn surface_capabilities(
&self,
physical_device: &PhysicalDevice
) -> Result<SurfaceCapabilitiesKHR>
unsafe fn surface_capabilities(
&self,
physical_device: &PhysicalDevice
) -> Result<SurfaceCapabilitiesKHR>
Returns the set of all supported surface capabilities.
Unsafe because the device’s supported extensions must be checked prior to querying the surface capabilities.