Interface JCSwapchainManagerType
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
JCSwapchainManager
A swapchain manager.
The manager is capable of creating swapchains, and transparently recreating them when they become suboptimal or invalid, or when the extent reported by the configured extent supplier changes.
-
Method Summary
Modifier and TypeMethodDescriptionacquire(JCSwapchainFrameIndex frameIndex) Acquire a frame for the given frame index.voidclose()events()
-
Method Details
-
events
Flow.Publisher<JCSwapchainEventType> events()- Returns:
- The swapchain events
-
acquire
Acquire a frame for the given frame index. The frame wraps a swapchain image together with the manager-owned semaphores and fences required to render and present it.The frame index is provided by the application and must index into the manager's frame-slot resources (that is, it must be in the range
[0, framesInFlight)). The manager uses the frame index to bound the re-signal of the acquire semaphore: before acquiring, it waits for the bounding fence of that frame slot, which is signalled by the submit that consumed the slot's acquire semaphore.Before acquiring, the manager checks the extent reported by the configured extent supplier. If it differs from the extent of the current swapchain, the swapchain is recreated with the new extent (clamped to the range supported by the implementation) before the frame is acquired.
- Parameters:
frameIndex- The frame index- Returns:
- A frame
- Throws:
VulkanException- On errors
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
VulkanException
-