glfwGetRequiredInstanceExtensions function

Pointer<Pointer<Utf8>> glfwGetRequiredInstanceExtensions(
  1. Pointer<Uint32> count
)

! @brief Returns the Vulkan instance extensions required by GLFW.

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 VkInstanceCreateInfo struct.

If Vulkan is not available on the machine, this function returns NULL and generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported to check whether Vulkan is at least minimally 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.

@paramout count Where to store the number of extensions in the returned array. This is set to zero if an error occurred. @return An array of ASCII encoded extension names, or NULL if an error(@ref error_handling) occurred.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref GLFW_API_UNAVAILABLE.

@remark 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.

@pointer_lifetime 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.

@thread_safety This function may be called from any thread.

@sa @ref vulkan_ext @sa @ref glfwCreateWindowSurface

@since Added in version 3.2.

@ingroup vulkan

GLFWAPI const char** glfwGetRequiredInstanceExtensions(uint32_t* count)

Implementation

Pointer<Pointer<Utf8>> glfwGetRequiredInstanceExtensions(
    Pointer<Uint32> count) {
  final glfwGetRequiredInstanceExtensionsLookupFunction =
      libglfw.lookupFunction<
          Pointer<Pointer<Utf8>> Function(Pointer<Uint32> count),
          Pointer<Pointer<Utf8>> Function(
              Pointer<Uint32> count)>('glfwGetRequiredInstanceExtensions');
  return glfwGetRequiredInstanceExtensionsLookupFunction(count);
}