Class KHRWin32Surface



  • public class KHRWin32Surface
    extends java.lang.Object
    The VK_KHR_win32_surface extension is an instance extension. It provides a mechanism to create a VkSurfaceKHR object (defined by the VK_KHR_surface extension) that refers to a Win32 HWND, as well as a query to determine support for rendering to the windows desktop.
    • Field Detail

      • VK_KHR_WIN32_SURFACE_SPEC_VERSION

        public static final int VK_KHR_WIN32_SURFACE_SPEC_VERSION
        The extension specification version.
        See Also:
        Constant Field Values
      • VK_KHR_WIN32_SURFACE_EXTENSION_NAME

        public static final java.lang.String VK_KHR_WIN32_SURFACE_EXTENSION_NAME
        The extension name.
        See Also:
        Constant Field Values
      • VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR

        public static final int VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR
        VkStructureType
        See Also:
        Constant Field Values
    • Method Detail

      • vkCreateWin32SurfaceKHR

        public static int vkCreateWin32SurfaceKHR(VkInstance instance,
                                                  VkWin32SurfaceCreateInfoKHR pCreateInfo,
                                                  VkAllocationCallbacks pAllocator,
                                                  java.nio.LongBuffer pSurface)
        Creates a VkSurfaceKHR object for a Win32 window.
        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

        With Win32, minImageExtent, maxImageExtent, and currentExtent are the window size. Therefore, a swapchain’s imageExtent must match the window’s size.

        Parameters:
        instance - the instance to associate the surface with
        pCreateInfo - a pointer to an instance of the VkWin32SurfaceCreateInfoKHR structure containing parameters affecting the creation of the surface object
        pAllocator - controls host memory allocation
        pSurface - points to a VkSurfaceKHR handle in which the created surface object is returned
      • vkGetPhysicalDeviceWin32PresentationSupportKHR

        public static int vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice,
                                                                         int queueFamilyIndex)
        Determines whether a queue family of a physical device supports presentation to the Microsoft Windows desktop.

        This platform-specific function can be called prior to creating a surface.

        Valid Usage
        • physicalDevice must be a valid VkPhysicalDevice handle
        • queueFamilyIndex must be less than pQueueFamilyPropertyCount returned by GetPhysicalDeviceQueueFamilyProperties for the given physicalDevice
        Parameters:
        physicalDevice - the physical device
        queueFamilyIndex - the queue family index