Class JCSwapchainManager

java.lang.Object
com.io7m.jcoronado.utility.swapchain.JCSwapchainManager
All Implemented Interfaces:
JCSwapchainManagerType, AutoCloseable

public final class JCSwapchainManager extends Object implements JCSwapchainManagerType
The swapchain manager.
  • Method Details

    • create

      public static JCSwapchainManagerType create(JCSwapchainConfiguration configuration) throws VulkanException
      Create a swapchain manager.
      Parameters:
      configuration - The configuration
      Returns:
      A manager
      Throws:
      VulkanException - On errors
    • events

      Specified by:
      events in interface JCSwapchainManagerType
      Returns:
      The swapchain events
    • acquire

      public JCSwapchainFrameType acquire(JCSwapchainFrameIndex frameIndex) throws VulkanException
      Description copied from interface: JCSwapchainManagerType
      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.

      Specified by:
      acquire in interface JCSwapchainManagerType
      Parameters:
      frameIndex - The frame index
      Returns:
      A frame
      Throws:
      VulkanException - On errors
    • close

      public void close() throws VulkanException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface JCSwapchainManagerType
      Throws:
      VulkanException