Class GLFWVulkan


  • public class GLFWVulkan
    extends java.lang.Object
    Native bindings to the GLFW library's Vulkan functions.
    • Method Detail

      • glfwVulkanSupported

        public static boolean glfwVulkanSupported()
        Returns whether the Vulkan loader has been found. This check is performed by Init.

        The availability of a Vulkan loader does not by itself guarantee that window surface creation or even device creation is possible. Call GetRequiredInstanceExtensions to check whether the extensions necessary for Vulkan surface creation are available and GetPhysicalDevicePresentationSupport to check whether a queue family of a physical device supports image presentation.

        Possible errors include NOT_INITIALIZED.

        This function may be called from any thread.

        Returns:
        TRUE if Vulkan is available, or FALSE otherwise
        Since:
        version 3.2
      • nglfwGetRequiredInstanceExtensions

        public static long nglfwGetRequiredInstanceExtensions​(long count)
        Parameters:
        count - where to store the number of extensions in the returned array. This is set to zero if an error occurred.
      • glfwGetRequiredInstanceExtensions

        @Nullable
        public static PointerBuffer glfwGetRequiredInstanceExtensions()
        Returns an array of names of Vulkan instance extensions required by GLFW for creating Vulkan surfaces for GLFW windows. If successful, the list will always contain VK_KHR_surface, so if you don't require any additional extensions you can pass this list directly to the VkInstanceCreateInfo struct.

        If Vulkan is not available on the machine, this function returns NULL and generates a API_UNAVAILABLE error. Call VulkanSupported to check whether Vulkan is available.

        If Vulkan is available but no set of extensions allowing window surface creation was found, this function returns NULL. You may still use Vulkan for off-screen rendering and compute work.

        Additional extensions may be required by future versions of GLFW. You should check if any extensions you wish to enable are already in the returned array, as it is an error to specify an extension more than once in the VkInstanceCreateInfo struct.

        The returned array is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the library is terminated.

        This function may be called from any thread.

        Possible errors include NOT_INITIALIZED and API_UNAVAILABLE.

        Returns:
        an array of ASCII encoded extension names, or NULL if an error occurred
        Since:
        version 3.2
      • nglfwGetInstanceProcAddress

        public static long nglfwGetInstanceProcAddress​(long instance,
                                                       long procname)
        Unsafe version of: GetInstanceProcAddress
      • glfwGetPhysicalDevicePresentationSupport

        public static boolean glfwGetPhysicalDevicePresentationSupport​(VkInstance instance,
                                                                       VkPhysicalDevice device,
                                                                       int queuefamily)
        Returns whether the specified queue family of the specified physical device supports presentation to the platform GLFW was built for.

        If Vulkan or the required window surface creation instance extensions are not available on the machine, or if the specified instance was not created with the required extensions, this function returns FALSE and generates a API_UNAVAILABLE error. Call VulkanSupported to check whether Vulkan is available and GetRequiredInstanceExtensions to check what instance extensions are required.

        Possible errors include NOT_INITIALIZED, API_UNAVAILABLE and PLATFORM_ERROR.

        This function may be called from any thread. For synchronization details of Vulkan objects, see the Vulkan specification.

        Parameters:
        instance - the instance that the physical device belongs to
        device - the physical device that the queue family belongs to
        queuefamily - the index of the queue family to query
        Returns:
        TRUE if the queue family supports presentation, or FALSE otherwise
        Since:
        version 3.2
      • nglfwCreateWindowSurface

        public static int nglfwCreateWindowSurface​(long instance,
                                                   long window,
                                                   long allocator,
                                                   long surface)
        Unsafe version of: CreateWindowSurface