Function ash_window::create_surface
source · pub unsafe fn create_surface(
entry: &Entry,
instance: &Instance,
display_handle: RawDisplayHandle,
window_handle: RawWindowHandle,
allocation_callbacks: Option<&AllocationCallbacks<'_>>
) -> VkResult<SurfaceKHR>
Expand description
Create a surface from a raw display and window handle.
instance
must have created with platform specific surface extensions enabled, acquired
through enumerate_required_extensions()
.
§Safety
There is a parent/child relation between Instance
and Entry
, and the resulting
vk::SurfaceKHR
. The application must not destroy these
parent objects before first destroying the returned
vk::SurfaceKHR
child object. vk::SurfaceKHR
does not implement drop
semantics and can only be destroyed via destroy_surface()
.
See the Entry::create_instance()
documentation for more destruction ordering rules on
Instance
.
The window represented by window_handle
must be associated with the display connection
in display_handle
.
window_handle
and display_handle
must be associated with a valid window and display
connection, which must not be destroyed for the lifetime of the returned vk::SurfaceKHR
.