Class VulkanSwapChainCreateInfo

java.lang.Object
com.io7m.jcoronado.extensions.khr_swapchain.api.VulkanSwapChainCreateInfo
All Implemented Interfaces:
VulkanSwapChainCreateInfoType

public final class VulkanSwapChainCreateInfo extends Object implements VulkanSwapChainCreateInfoType
Information needed to create a swap chain.
See Also:
  • "VkSwapchainCreateInfoKHR"
  • Method Details

    • surface

      Specified by:
      surface in interface VulkanSwapChainCreateInfoType
      Returns:
      The swapchain's target surface
    • minimumImageCount

      public int minimumImageCount()
      Specified by:
      minimumImageCount in interface VulkanSwapChainCreateInfoType
      Returns:
      The minimum number of presentation images the application needs
    • imageFormat

      public VulkanFormat imageFormat()
      Specified by:
      imageFormat in interface VulkanSwapChainCreateInfoType
      Returns:
      The format of the presentation images
    • imageColorSpace

      public VulkanColorSpaceKHR imageColorSpace()
      Specified by:
      imageColorSpace in interface VulkanSwapChainCreateInfoType
      Returns:
      The colorspace of the presentation images
    • imageExtent

      public VulkanExtent2D imageExtent()
      Specified by:
      imageExtent in interface VulkanSwapChainCreateInfoType
      Returns:
      The dimensions of the presentation images
    • imageArrayLayers

      public int imageArrayLayers()
      Specified by:
      imageArrayLayers in interface VulkanSwapChainCreateInfoType
      Returns:
      The number of views for multiview/stereo presentation
    • imageUsageFlags

      public Set<VulkanImageUsageFlag> imageUsageFlags()
      Specified by:
      imageUsageFlags in interface VulkanSwapChainCreateInfoType
      Returns:
      The sharing mode used for the presentation images
    • imageSharingMode

      public VulkanSharingMode imageSharingMode()
      Specified by:
      imageSharingMode in interface VulkanSwapChainCreateInfoType
      Returns:
      The sharing mode used for the presentation images
    • queueFamilyIndices

      public List<VulkanQueueFamilyIndex> queueFamilyIndices()
      Specified by:
      queueFamilyIndices in interface VulkanSwapChainCreateInfoType
      Returns:
      The queue family indices having access to the images in case of concurrent sharing mode
    • preTransform

      public Set<VulkanSurfaceTransformFlagKHR> preTransform()
      Specified by:
      preTransform in interface VulkanSwapChainCreateInfoType
      Returns:
      The transform, relative to the device's natural orientation, applied to the image content prior to presentation
    • compositeAlpha

      public Set<VulkanCompositeAlphaFlagKHR> compositeAlpha()
      Specified by:
      compositeAlpha in interface VulkanSwapChainCreateInfoType
      Returns:
      The alpha blending mode used when compositing this surface with other surfaces in the window system
    • presentMode

      public VulkanPresentModeKHR presentMode()
      Specified by:
      presentMode in interface VulkanSwapChainCreateInfoType
      Returns:
      The presentation mode to use for presents on this swap chain
    • clipped

      public boolean clipped()
      Specified by:
      clipped in interface VulkanSwapChainCreateInfoType
      Returns:
      true if presentable images may be affected by window clip regions
    • oldSwapChain

      Specified by:
      oldSwapChain in interface VulkanSwapChainCreateInfoType
      Returns:
      The existing swap chain to replace, if any
    • withSurface

      Copy the current immutable object by setting a value for the surface attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for surface
      Returns:
      A modified copy of the this object
    • withMinimumImageCount

      public final VulkanSwapChainCreateInfo withMinimumImageCount(int value)
      Copy the current immutable object by setting a value for the minimumImageCount attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for minimumImageCount
      Returns:
      A modified copy of the this object
    • withImageFormat

      public final VulkanSwapChainCreateInfo withImageFormat(VulkanFormat value)
      Copy the current immutable object by setting a value for the imageFormat attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for imageFormat
      Returns:
      A modified copy of the this object
    • withImageColorSpace

      public final VulkanSwapChainCreateInfo withImageColorSpace(VulkanColorSpaceKHR value)
      Copy the current immutable object by setting a value for the imageColorSpace attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for imageColorSpace
      Returns:
      A modified copy of the this object
    • withImageExtent

      public final VulkanSwapChainCreateInfo withImageExtent(VulkanExtent2D value)
      Copy the current immutable object by setting a value for the imageExtent attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for imageExtent
      Returns:
      A modified copy of the this object
    • withImageArrayLayers

      public final VulkanSwapChainCreateInfo withImageArrayLayers(int value)
      Copy the current immutable object by setting a value for the imageArrayLayers attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for imageArrayLayers
      Returns:
      A modified copy of the this object
    • withImageUsageFlags

      public final VulkanSwapChainCreateInfo withImageUsageFlags(VulkanImageUsageFlag... elements)
      Copy the current immutable object with elements that replace the content of imageUsageFlags.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withImageUsageFlags

      public final VulkanSwapChainCreateInfo withImageUsageFlags(Iterable<VulkanImageUsageFlag> elements)
      Copy the current immutable object with elements that replace the content of imageUsageFlags. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of imageUsageFlags elements to set
      Returns:
      A modified copy of this object
    • withImageSharingMode

      public final VulkanSwapChainCreateInfo withImageSharingMode(VulkanSharingMode value)
      Copy the current immutable object by setting a value for the imageSharingMode attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for imageSharingMode
      Returns:
      A modified copy of the this object
    • withQueueFamilyIndices

      public final VulkanSwapChainCreateInfo withQueueFamilyIndices(VulkanQueueFamilyIndex... elements)
      Copy the current immutable object with elements that replace the content of queueFamilyIndices.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withQueueFamilyIndices

      public final VulkanSwapChainCreateInfo withQueueFamilyIndices(Iterable<? extends VulkanQueueFamilyIndex> elements)
      Copy the current immutable object with elements that replace the content of queueFamilyIndices. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of queueFamilyIndices elements to set
      Returns:
      A modified copy of this object
    • withPreTransform

      public final VulkanSwapChainCreateInfo withPreTransform(VulkanSurfaceTransformFlagKHR... elements)
      Copy the current immutable object with elements that replace the content of preTransform.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withPreTransform

      public final VulkanSwapChainCreateInfo withPreTransform(Iterable<VulkanSurfaceTransformFlagKHR> elements)
      Copy the current immutable object with elements that replace the content of preTransform. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of preTransform elements to set
      Returns:
      A modified copy of this object
    • withCompositeAlpha

      public final VulkanSwapChainCreateInfo withCompositeAlpha(VulkanCompositeAlphaFlagKHR... elements)
      Copy the current immutable object with elements that replace the content of compositeAlpha.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withCompositeAlpha

      public final VulkanSwapChainCreateInfo withCompositeAlpha(Iterable<VulkanCompositeAlphaFlagKHR> elements)
      Copy the current immutable object with elements that replace the content of compositeAlpha. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of compositeAlpha elements to set
      Returns:
      A modified copy of this object
    • withPresentMode

      public final VulkanSwapChainCreateInfo withPresentMode(VulkanPresentModeKHR value)
      Copy the current immutable object by setting a value for the presentMode attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for presentMode
      Returns:
      A modified copy of the this object
    • withClipped

      public final VulkanSwapChainCreateInfo withClipped(boolean value)
      Copy the current immutable object by setting a value for the clipped attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for clipped
      Returns:
      A modified copy of the this object
    • withOldSwapChain

      Copy the current immutable object by setting a present value for the optional oldSwapChain attribute.
      Parameters:
      value - The value for oldSwapChain
      Returns:
      A modified copy of this object
    • withOldSwapChain

      public final VulkanSwapChainCreateInfo withOldSwapChain(Optional<? extends VulkanExtKHRSwapChainType.VulkanKHRSwapChainType> optional)
      Copy the current immutable object by setting an optional value for the oldSwapChain attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for oldSwapChain
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of VulkanSwapChainCreateInfo that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: surface, minimumImageCount, imageFormat, imageColorSpace, imageExtent, imageArrayLayers, imageUsageFlags, imageSharingMode, queueFamilyIndices, preTransform, compositeAlpha, presentMode, clipped, oldSwapChain.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value VulkanSwapChainCreateInfo with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static VulkanSwapChainCreateInfo of(VulkanExtKHRSurfaceType.VulkanKHRSurfaceType surface, int minimumImageCount, VulkanFormat imageFormat, VulkanColorSpaceKHR imageColorSpace, VulkanExtent2D imageExtent, int imageArrayLayers, Set<VulkanImageUsageFlag> imageUsageFlags, VulkanSharingMode imageSharingMode, List<VulkanQueueFamilyIndex> queueFamilyIndices, Set<VulkanSurfaceTransformFlagKHR> preTransform, Set<VulkanCompositeAlphaFlagKHR> compositeAlpha, VulkanPresentModeKHR presentMode, boolean clipped, Optional<VulkanExtKHRSwapChainType.VulkanKHRSwapChainType> oldSwapChain)
      Construct a new immutable VulkanSwapChainCreateInfo instance.
      Parameters:
      surface - The value for the surface attribute
      minimumImageCount - The value for the minimumImageCount attribute
      imageFormat - The value for the imageFormat attribute
      imageColorSpace - The value for the imageColorSpace attribute
      imageExtent - The value for the imageExtent attribute
      imageArrayLayers - The value for the imageArrayLayers attribute
      imageUsageFlags - The value for the imageUsageFlags attribute
      imageSharingMode - The value for the imageSharingMode attribute
      queueFamilyIndices - The value for the queueFamilyIndices attribute
      preTransform - The value for the preTransform attribute
      compositeAlpha - The value for the compositeAlpha attribute
      presentMode - The value for the presentMode attribute
      clipped - The value for the clipped attribute
      oldSwapChain - The value for the oldSwapChain attribute
      Returns:
      An immutable VulkanSwapChainCreateInfo instance
    • of

      public static VulkanSwapChainCreateInfo of(VulkanExtKHRSurfaceType.VulkanKHRSurfaceType surface, int minimumImageCount, VulkanFormat imageFormat, VulkanColorSpaceKHR imageColorSpace, VulkanExtent2D imageExtent, int imageArrayLayers, Iterable<VulkanImageUsageFlag> imageUsageFlags, VulkanSharingMode imageSharingMode, Iterable<? extends VulkanQueueFamilyIndex> queueFamilyIndices, Iterable<VulkanSurfaceTransformFlagKHR> preTransform, Iterable<VulkanCompositeAlphaFlagKHR> compositeAlpha, VulkanPresentModeKHR presentMode, boolean clipped, Optional<? extends VulkanExtKHRSwapChainType.VulkanKHRSwapChainType> oldSwapChain)
      Construct a new immutable VulkanSwapChainCreateInfo instance.
      Parameters:
      surface - The value for the surface attribute
      minimumImageCount - The value for the minimumImageCount attribute
      imageFormat - The value for the imageFormat attribute
      imageColorSpace - The value for the imageColorSpace attribute
      imageExtent - The value for the imageExtent attribute
      imageArrayLayers - The value for the imageArrayLayers attribute
      imageUsageFlags - The value for the imageUsageFlags attribute
      imageSharingMode - The value for the imageSharingMode attribute
      queueFamilyIndices - The value for the queueFamilyIndices attribute
      preTransform - The value for the preTransform attribute
      compositeAlpha - The value for the compositeAlpha attribute
      presentMode - The value for the presentMode attribute
      clipped - The value for the clipped attribute
      oldSwapChain - The value for the oldSwapChain attribute
      Returns:
      An immutable VulkanSwapChainCreateInfo instance
    • copyOf

      Creates an immutable copy of a VulkanSwapChainCreateInfoType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable VulkanSwapChainCreateInfo instance
    • builder

      public static VulkanSwapChainCreateInfo.Builder builder()
      Creates a builder for VulkanSwapChainCreateInfo.
       VulkanSwapChainCreateInfo.builder()
          .setSurface(com.io7m.jcoronado.extensions.khr_surface.api.VulkanExtKHRSurfaceType.VulkanKHRSurfaceType) // required surface
          .setMinimumImageCount(int) // required minimumImageCount
          .setImageFormat(com.io7m.jcoronado.api.VulkanFormat) // required imageFormat
          .setImageColorSpace(com.io7m.jcoronado.extensions.khr_swapchain.api.VulkanColorSpaceKHR) // required imageColorSpace
          .setImageExtent(com.io7m.jcoronado.api.VulkanExtent2D) // required imageExtent
          .setImageArrayLayers(int) // required imageArrayLayers
          .addImageUsageFlags|addAllImageUsageFlags(com.io7m.jcoronado.api.VulkanImageUsageFlag) // imageUsageFlags elements
          .setImageSharingMode(com.io7m.jcoronado.api.VulkanSharingMode) // required imageSharingMode
          .addQueueFamilyIndices|addAllQueueFamilyIndices(com.io7m.jcoronado.api.VulkanQueueFamilyIndex) // queueFamilyIndices elements
          .addPreTransform|addAllPreTransform(com.io7m.jcoronado.extensions.khr_surface.api.VulkanSurfaceTransformFlagKHR) // preTransform elements
          .addCompositeAlpha|addAllCompositeAlpha(com.io7m.jcoronado.extensions.khr_swapchain.api.VulkanCompositeAlphaFlagKHR) // compositeAlpha elements
          .setPresentMode(com.io7m.jcoronado.extensions.khr_swapchain.api.VulkanPresentModeKHR) // required presentMode
          .setClipped(boolean) // required clipped
          .setOldSwapChain(com.io7m.jcoronado.extensions.khr_swapchain.api.VulkanExtKHRSwapChainType.VulkanKHRSwapChainType) // optional oldSwapChain
          .build();
       
      Returns:
      A new VulkanSwapChainCreateInfo builder