createAndroidSurfaceKHR :: MonadIO io=> Instanceinstanceis the instance to associate the surface with.-> AndroidSurfaceCreateInfoKHRpCreateInfois a pointer to a AndroidSurfaceCreateInfoKHR structure containing parameters affecting the creation of the surface object.->"allocator"
::: Maybe AllocationCallbackspAllocatoris the allocator used for host memory allocated for the surface object when there is no more specific allocator available (see Memory Allocation).-> io SurfaceKHR
vkCreateAndroidSurfaceKHR - Create a SurfaceKHR object for an Android native window
Description
During the lifetime of a surface created using a particular ANativeWindow handle any attempts to create another surface for the same ANativeWindow and any attempts to connect to the same ANativeWindow through other platform mechanisms will fail.
In particular, only one SurfaceKHR can
exist at a time for a given window. Similarly, a native window cannot
be used by both a SurfaceKHR and
EGLSurface simultaneously.
If successful, createAndroidSurfaceKHR increments the ANativeWindow’s reference count, and destroySurfaceKHR will decrement it.
On Android, when a swapchain’s imageExtent does not match the
surface’s currentExtent, the presentable images will be scaled to the
surface’s dimensions during presentation. minImageExtent is (1,1), and
maxImageExtent is the maximum image size supported by the consumer.
For the system compositor, currentExtent is the window size (i.e. the
consumer’s preferred size).
Valid Usage (Implicit)
instancemust be a valid Instance handle
pCreateInfomust be a valid pointer to a valid AndroidSurfaceCreateInfoKHR structureIf
pAllocatoris notNULL,pAllocatormust be a valid pointer to a valid AllocationCallbacks structurepSurfacemust be a valid pointer to a SurfaceKHR handle
Return Codes
See Also
VK_KHR_android_surface, AllocationCallbacks, AndroidSurfaceCreateInfoKHR, Instance, SurfaceKHR