VKCREATEWIN32SURFACE(3)

NAME
vkCreateWin32SurfaceKHR - create a VkSurfaceKHR object for a Win32 window.

C SPECIFICATION

    VkResult vkCreateWin32SurfaceKHR(
        VkInstance                                  instance,
        const VkWin32SurfaceCreateInfoKHR*          pCreateInfo,
        const VkAllocationCallbacks*                pAllocator,
        VkSurfaceKHR*                               pSurface);

PARAMETERS

instance
    The VkInstance to associate the surface.

pCreateInfo
    A pointer to an instance of the VkWin32SurfaceCreateInfoKHR structure containing the parameters affecting the creation of the surface object.

pAllocator
    The allocator used for host memory allocated for the surface object.

pSurface
    The resulting surface object handle is returned in pSurface.

DESCRIPTION

vkCreateWin32SurfaceKHR creates a VkSurface associated with the specified Win32 native window.

pCreateInfo is an instance of the VkWin32SurfaceCreateInfoKHR structure, the definition of which is:

    typedef struct VkWin32SurfaceCreateInfoKHR {
        VkStructureType                 sType;
        const void*                     pNext;
        VkWin32SurfaceCreateFlagsKHR    flags;
        HINSTANCE                       hinstance;
        HWND                            hwnd;
    } VkWin32SurfaceCreateInfoKHR;

VALID USAGE

    • instance must be a valid VkInstance handle

    • pCreateInfo must be a pointer to a valid VkWin32SurfaceCreateInfoKHR structure

    • If pAllocator is not NULL, pAllocator must be a pointer to a valid VkAllocationCallbacks structure

    • pSurface must be a pointer to a VkSurfaceKHR handle

RETURN CODES

On success, this command returns

        • VK_SUCCESS

On failure, this command returns

        • VK_ERROR_OUT_OF_HOST_MEMORY

        • VK_ERROR_OUT_OF_DEVICE_MEMORY

SEE ALSO

vkDestroySurfaceKHR, vkGetPhysicalDeviceSurfaceCapabilitiesKHR, vkGetPhysicalDeviceSurfaceFormatsKHR, vkGetPhysicalDeviceSurfacePresentModesKHR, vkCreateSwapchainKHR

COPYRIGHT

Copyright © 2014-2016 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

AUTHOR

Khronos Group
    Author.