Class VulkanGLFWRenderModuleRenderModuleSurface
java.lang.Object
io.codetoil.curved_spacetime.render.vulkan.VulkanRenderModuleSurface
io.codetoil.curved_spacetime.render.vulkan_glfw.VulkanGLFWRenderModuleRenderModuleSurface
A Vulkan surface created from a GLFW window.
GLFW handles the platform-specific part of surface creation, so this class does not need to know whether it is running on X11, Wayland, Win32, or Cocoa. Capabilities and format are queried once at construction, which means the surface must be recreated if the window is resized.
-
Nested Class Summary
Nested classes/interfaces inherited from class VulkanRenderModuleSurface
VulkanRenderModuleSurface.SurfaceFormat -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.lwjgl.vulkan.VkSurfaceCapabilitiesKHRWhat this surface supports, queried at construction.protected final VulkanRenderModuleSurface.SurfaceFormatThe pixel format and colour space negotiated for this surface.protected final longThe underlying Vulkan surface handle.Fields inherited from class VulkanRenderModuleSurface
logger, vulkanModulePhysicalDevice -
Constructor Summary
ConstructorsConstructorDescriptionVulkanGLFWRenderModuleRenderModuleSurface(VulkanModuleVulkanInstance vulkanModuleVulkanInstance, VulkanModulePhysicalDevice vulkanModulePhysicalDevice, long windowHandle, Logger logger) Creates a Vulkan surface onto the given GLFW window. -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Destroys the surface and releases the platform resources behind it.org.lwjgl.vulkan.VkSurfaceCapabilitiesKHRReturns what this surface supports: image count bounds, extent bounds, and transforms.Returns the pixel format and colour space chosen for this surface.longReturns the underlying Vulkan handle.Methods inherited from class VulkanRenderModuleSurface
calcSurfaceFormat
-
Field Details
-
surfaceCaps
protected final org.lwjgl.vulkan.VkSurfaceCapabilitiesKHR surfaceCapsWhat this surface supports, queried at construction. -
surfaceFormat
The pixel format and colour space negotiated for this surface. -
vkSurface
protected final long vkSurfaceThe underlying Vulkan surface handle.
-
-
Constructor Details
-
VulkanGLFWRenderModuleRenderModuleSurface
public VulkanGLFWRenderModuleRenderModuleSurface(VulkanModuleVulkanInstance vulkanModuleVulkanInstance, VulkanModulePhysicalDevice vulkanModulePhysicalDevice, long windowHandle, Logger logger) Creates a Vulkan surface onto the given GLFW window.- Parameters:
vulkanModuleVulkanInstance- the instance to create the surface againstvulkanModulePhysicalDevice- the device to query surface support onwindowHandle- the GLFW window to present intologger- the logger to write surface diagnostics to- Throws:
AssertionError- if the surface capabilities or formats cannot be queried
-
-
Method Details
-
cleanup
public void cleanup()Description copied from class:VulkanRenderModuleSurfaceDestroys the surface and releases the platform resources behind it.- Specified by:
cleanupin classVulkanRenderModuleSurface
-
getSurfaceCaps
public org.lwjgl.vulkan.VkSurfaceCapabilitiesKHR getSurfaceCaps()Description copied from class:VulkanRenderModuleSurfaceReturns what this surface supports: image count bounds, extent bounds, and transforms.A swap chain must be built within these limits.
- Specified by:
getSurfaceCapsin classVulkanRenderModuleSurface- Returns:
- the surface capabilities
-
getSurfaceFormat
Description copied from class:VulkanRenderModuleSurfaceReturns the pixel format and colour space chosen for this surface.- Specified by:
getSurfaceFormatin classVulkanRenderModuleSurface- Returns:
- the negotiated surface format
-
getVkSurface
public long getVkSurface()Description copied from class:VulkanRenderModuleSurfaceReturns the underlying Vulkan handle.- Specified by:
getVkSurfacein classVulkanRenderModuleSurface- Returns:
- the
VkSurfaceKHRhandle
-