Class VulkanBackend
java.lang.Object
dev.engine.graphics.vulkan.VulkanBackend
Vulkan backend factory.
Requires a WindowToolkit that supports Vulkan surface creation.
var platform = DesktopPlatform.builder().build();
new MyGame().launch(config.toBuilder()
.graphicsBackend(VulkanBackend.factory(toolkit, surfaceCreator, vkBindings))
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCreates a Vulkan surface from a VkInstance handle and a native window handle. -
Method Summary
Modifier and TypeMethodDescriptionstatic GraphicsBackendFactoryfactory(WindowToolkit toolkit, VulkanBackend.SurfaceCreator surfaceCreator, VkBindings vk) Creates a Vulkan backend factory using the given window toolkit.static GraphicsBackendFactoryfactory(WindowToolkit toolkit, VulkanBackend.SurfaceCreator surfaceCreator, VkBindings vk, int presentMode) Creates a Vulkan backend factory with a specific present mode.
-
Method Details
-
factory
public static GraphicsBackendFactory factory(WindowToolkit toolkit, VulkanBackend.SurfaceCreator surfaceCreator, VkBindings vk) Creates a Vulkan backend factory using the given window toolkit. The caller provides a surface creation function since it's toolkit-specific.- Parameters:
toolkit- the window toolkit (e.g., GLFW with NO_API hints)surfaceCreator- given (VkInstance handle, nativeWindowHandle) returns VkSurfaceKHR handlevk- the Vulkan bindings implementation
-
factory
public static GraphicsBackendFactory factory(WindowToolkit toolkit, VulkanBackend.SurfaceCreator surfaceCreator, VkBindings vk, int presentMode) Creates a Vulkan backend factory with a specific present mode.- Parameters:
presentMode- one ofVkBindings.VK_PRESENT_MODE_FIFO_KHR(vsync),VK_PRESENT_MODE_MAILBOX_KHR(triple-buffered), orVK_PRESENT_MODE_IMMEDIATE_KHR(no vsync)
-