# 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 Summary

  Modifier and Type
  Method
  Description
  `JCSwapchainImageType`
  `acquire()`
  Acquire a swapchain image.
  `void`
  `close()`
  `static JCSwapchainManagerType`
  `create(JCSwapchainConfiguration configuration)`
  Create a swapchain manager.
  `Flow.Publisher<JCSwapchainEventType>`
  `events()`
  `Set<JCSwapchainImageIndex>`
  `imageIndices()`
  Get a set comprising the indices of the swapchain.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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

    public Flow.Publisher<JCSwapchainEventType> events()
    Specified by:
      `events` in interface `JCSwapchainManagerType`
    Returns:
      The swapchain events

  - ### acquire

    public JCSwapchainImageType acquire() throws VulkanException
    Description copied from interface: `JCSwapchainManagerType`
    Acquire a swapchain image. The method is guaranteed to return an image that is usable (if not necessarily optimal) on the current device. In the case of an image being suboptimal, the swapchain will automatically be recreated at the earliest possible opportunity.
    Specified by:
      `acquire` in interface `JCSwapchainManagerType`
    Returns:
      A swapchain image
    Throws:
      `VulkanException` - On errors

  - ### imageIndices

    public Set<JCSwapchainImageIndex> imageIndices()
    Description copied from interface: `JCSwapchainManagerType`
    Get a set comprising the indices of the swapchain. This can be used as an index into a map to store per-frame resources externally.
    Specified by:
      `imageIndices` in interface `JCSwapchainManagerType`
    Returns:
      The set of swapchain image indices

  - ### close

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