This is the reference documentation for Vulkan related functions and types. For more task-oriented information, see the Vulkan guide.
|typedef void(*||GLFWvkproc) (void)|
|Vulkan API function pointer type. More...|
|Returns whether the Vulkan loader and an ICD have been found. More...|
|const char **||glfwGetRequiredInstanceExtensions (uint32_t *count)|
|Returns the Vulkan instance extensions required by GLFW. More...|
|GLFWvkproc||glfwGetInstanceProcAddress (VkInstance instance, const char *procname)|
|Returns the address of the specified Vulkan instance function. More...|
|int||glfwGetPhysicalDevicePresentationSupport (VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily)|
|Returns whether the specified queue family can present images. More...|
|VkResult||glfwCreateWindowSurface (VkInstance instance, GLFWwindow *window, const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface)|
|Creates a Vulkan surface for the specified window. More...|
|typedef void(* GLFWvkproc) (void)|
This function returns whether the Vulkan loader and any minimally functional ICD have been found.
The availability of a Vulkan loader and even an ICD does not by itself guarantee that surface creation or even instance creation is possible. Call glfwGetRequiredInstanceExtensions to check whether the extensions necessary for Vulkan surface creation are available and glfwGetPhysicalDevicePresentationSupport to check whether a queue family of a physical device supports image presentation.
GLFW_TRUEif Vulkan is minimally available, or
|const char ** glfwGetRequiredInstanceExtensions||(||uint32_t *||count||)|
This function 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
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.
|[out]||count||Where to store the number of extensions in the returned array. This is set to zero if an error occurred.|
NULLif an error occurred.
|const char *||procname|
This function returns the address of the specified Vulkan core or extension function for the specified instance. If instance is set to
NULL it can return any function exported from the Vulkan loader, including at least the following functions:
This function is equivalent to calling
vkGetInstanceProcAddr with a platform-specific query of the Vulkan loader as a fallback.
|[in]||instance||The Vulkan instance to query, or |
|[in]||procname||The ASCII encoded name of the function.|
NULLif an error occurred.
This function 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
GLFW_FALSE and generates a GLFW_API_UNAVAILABLE error. Call glfwVulkanSupported to check whether Vulkan is at least minimally available and glfwGetRequiredInstanceExtensions to check what instance extensions are required.
|[in]||instance||The instance that the physical device belongs to.|
|[in]||device||The physical device that the queue family belongs to.|
|[in]||queuefamily||The index of the queue family to query.|
GLFW_TRUEif the queue family supports presentation, or
GLFW_TRUE, as the
VK_EXT_metal_surfaceextensions do not provide a
|const VkAllocationCallbacks *||allocator,|
This function creates a Vulkan surface for the specified window.
If the Vulkan loader or at least one minimally functional ICD were not found, this function returns
VK_ERROR_INITIALIZATION_FAILED and generates a GLFW_API_UNAVAILABLE error. Call glfwVulkanSupported to check whether Vulkan is at least minimally available.
If the required window surface creation instance extensions are not available or if the specified instance was not created with these extensions enabled, this function returns
VK_ERROR_EXTENSION_NOT_PRESENT and generates a GLFW_API_UNAVAILABLE error. Call glfwGetRequiredInstanceExtensions to check what instance extensions are required.
The window surface cannot be shared with another API so the window must have been created with the client api hint set to
GLFW_NO_API otherwise it generates a GLFW_INVALID_VALUE error and returns
The window surface must be destroyed before the specified Vulkan instance. It is the responsibility of the caller to destroy the window surface. GLFW does not destroy it for you. Call
vkDestroySurfaceKHR to destroy the surface.
|[in]||instance||The Vulkan instance to create the surface in.|
|[in]||window||The window to create the surface for.|
|[in]||allocator||The allocator to use, or |
|[out]||surface||Where to store the handle of the surface. This is set to |
VK_SUCCESSif successful, or a Vulkan error code if an error occurred.
VK_EXT_metal_surfaceextension, with the
VK_MVK_macos_surfaceextension as a fallback. The name of the selected extension, if any, is included in the array returned by glfwGetRequiredInstanceExtensions.
CAMetalLayerinstance for the window content view, which is required for MoltenVK to function.
Last update on Tue Apr 5 2022 for GLFW 3.3.7