GLFWVulkan relies on preview features of the Java platform:
GLFWVulkanrefers to one or more preview APIs:MemorySegment.
- Since:
 - 0.1.0
 - Author:
 - squid233
 
- 
Method Summary
Modifier and TypeMethodDescriptionstatic intglfwCreateWindowSurface(MemorySegmentPREVIEW instance, MemorySegmentPREVIEW window, MemorySegmentPREVIEW allocator, long[] surface) Creates a Vulkan surface for the specified window.static MemorySegmentPREVIEWglfwGetInstanceProcAddress(MemorySegmentPREVIEW instance, String procName) Returns the address of the specified Vulkan instance function.static booleanglfwGetPhysicalDevicePresentationSupport(MemorySegmentPREVIEW instance, MemorySegmentPREVIEW device, int queueFamily) Returns whether the specified queue family can present images.static intnglfwCreateWindowSurface(MemorySegmentPREVIEW instance, MemorySegmentPREVIEW window, MemorySegmentPREVIEW allocator, MemorySegmentPREVIEW surface) Creates a Vulkan surface for the specified window.static MemorySegmentPREVIEWnglfwGetInstanceProcAddress(MemorySegmentPREVIEW instance, MemorySegmentPREVIEW procName) Returns the address of the specified Vulkan instance function. 
- 
Method Details
- 
nglfwGetInstanceProcAddress
public static MemorySegmentPREVIEW nglfwGetInstanceProcAddress(MemorySegmentPREVIEW instance, MemorySegmentPREVIEW procName) Returns the address of the specified Vulkan instance function.This function returns the address of the specified Vulkan core or extension function for the specified instance. If instance is set to
NULLPREVIEW it can return any function exported from the Vulkan loader, including at least the following functions:vkEnumerateInstanceExtensionPropertiesvkEnumerateInstanceLayerPropertiesvkCreateInstancevkGetInstanceProcAddr
If Vulkan is not available on the machine, this function returns
NULLPREVIEW and generates aAPI_UNAVAILABLEerror. CallvulkanSupportedto check whether Vulkan is at least minimally available.This function is equivalent to calling
vkGetInstanceProcAddrwith a platform-specific query of the Vulkan loader as a fallback.- Parameters:
 instance- The Vulkan instance to query, orNULLPREVIEW to retrieve functions related to instance creation.procName- The ASCII encoded name of the function.- Returns:
 - The address of the function, or 
NULLPREVIEW if an error occurred. - Errors:
 - Possible errors include 
NOT_INITIALIZEDandAPI_UNAVAILABLE. - Thread safety:
 - This function may be called from any thread.
 - Pointer lifetime:
 - The returned function pointer is valid until the library is terminated.
 
 - 
glfwGetInstanceProcAddress
public static MemorySegmentPREVIEW glfwGetInstanceProcAddress(MemorySegmentPREVIEW instance, String procName) Returns the address of the specified Vulkan instance function. - 
glfwGetPhysicalDevicePresentationSupport
public static boolean glfwGetPhysicalDevicePresentationSupport(MemorySegmentPREVIEW instance, MemorySegmentPREVIEW device, int queueFamily) Returns whether the specified queue family can present images.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
falseand generates aAPI_UNAVAILABLEerror. CallvulkanSupportedto check whether Vulkan is at least minimally available andgetRequiredInstanceExtensionsPREVIEW to check what instance extensions are required.- 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:
 trueif the queue family supports presentation, orfalseotherwise.- Errors:
 - Possible errors include 
NOT_INITIALIZED,API_UNAVAILABLEandPLATFORM_ERROR. - Remarks:
 - macOS: This function currently always returns 
true, as theVK_MVK_macos_surfaceandVK_EXT_metal_surfaceextensions do not provide avkGetPhysicalDevice*PresentationSupporttype function. - Thread safety:
 - This function may be called from any thread. For synchronization details of Vulkan objects, see the Vulkan specification.
 
 - 
nglfwCreateWindowSurface
public static int nglfwCreateWindowSurface(MemorySegmentPREVIEW instance, MemorySegmentPREVIEW window, MemorySegmentPREVIEW allocator, MemorySegmentPREVIEW surface) Creates a Vulkan surface for the specified window.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_FAILEDand generates aAPI_UNAVAILABLEerror. CallvulkanSupportedto 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_PRESENTand generates aAPI_UNAVAILABLEerror. CallgetRequiredInstanceExtensionsPREVIEW 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 hintset toNO_APIotherwise it generates aINVALID_VALUEerror and returnsVK_ERROR_NATIVE_WINDOW_IN_USE_KHR.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
vkDestroySurfaceKHRto destroy the surface.- Parameters:
 instance- The Vulkan instance to create the surface in.window- The window to create the surface for.allocator- The allocator to use, orNULLPREVIEW to use the default allocator.surface- Where to store the handle of the surface. This is set toVK_NULL_HANDLEif an error occurred.- Returns:
 VK_SUCCESSif successful, or a Vulkan error code if an error occurred.- See Also:
 - Errors:
 - Possible errors include 
NOT_INITIALIZED,API_UNAVAILABLE,PLATFORM_ERRORandINVALID_VALUE. - Remarks:
 - If an error occurs before the creation call is made, GLFW returns
 the Vulkan error code most appropriate for the error.  Appropriate use of
 
vulkanSupportedandgetRequiredInstanceExtensionsPREVIEW should eliminate almost all occurrences of these errors.macOS: GLFW prefers the
VK_EXT_metal_surfaceextension, with theVK_MVK_macos_surfaceextension as a fallback. The name of the selected extension, if any, is included in the array returned bygetRequiredInstanceExtensionsPREVIEW.macOS: This function creates and sets a
CAMetalLayerinstance for the window content view, which is required for MoltenVK to function. - Thread safety:
 - This function may be called from any thread. For synchronization details of Vulkan objects, see the Vulkan specification.
 
 - 
glfwCreateWindowSurface
public static int glfwCreateWindowSurface(MemorySegmentPREVIEW instance, MemorySegmentPREVIEW window, MemorySegmentPREVIEW allocator, long[] surface) Creates a Vulkan surface for the specified window.- Parameters:
 instance- The Vulkan instance to create the surface in.window- The window to create the surface for.allocator- The allocator to use, orNULLPREVIEW to use the default allocator.surface- Where to store the handle of the surface. This is set toVK_NULL_HANDLEif an error occurred.- Returns:
 VK_SUCCESSif successful, or a Vulkan error code if an error occurred.- See Also:
 
 
 - 
 
GLFWVulkanwhen preview features are enabled.