Class JCSwapchainConfiguration
java.lang.Object
com.io7m.jcoronado.utility.swapchain.JCSwapchainConfiguration
- All Implemented Interfaces:
JCSwapchainConfigurationType
The configuration values required to create (and re-create) swapchains.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeJCSwapchainConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forJCSwapchainConfiguration.static JCSwapchainConfigurationcopyOf(JCSwapchainConfigurationType instance) Creates an immutable copy of aJCSwapchainConfigurationTypevalue.device()booleanThis instance is equal to all instances ofJCSwapchainConfigurationthat have equal attribute values.inthashCode()Computes a hash code from attributes:requestedMinimumImages,device,surface,swapChainExtension,surfaceExtension,graphicsQueue,presentationQueue,preferredModes,preferredFormats,imageUsageFlags,surfaceAlphaFlags.The list of surface formats to try in order of preference (earlier entries have higher preference).The list of presentation modes to try in order of preference (earlier entries have higher preference).intsurface()toString()Prints the immutable valueJCSwapchainConfigurationwith attribute values.final JCSwapchainConfigurationCopy the current immutable object by setting a value for thedeviceattribute.final JCSwapchainConfigurationwithGraphicsQueue(VulkanQueueType value) Copy the current immutable object by setting a value for thegraphicsQueueattribute.final JCSwapchainConfigurationwithImageUsageFlags(VulkanImageUsageFlag... elements) Copy the current immutable object with elements that replace the content ofimageUsageFlags.final JCSwapchainConfigurationwithImageUsageFlags(Iterable<VulkanImageUsageFlag> elements) Copy the current immutable object with elements that replace the content ofimageUsageFlags.final JCSwapchainConfigurationwithPreferredFormats(VulkanSurfaceFormatKHR... elements) Copy the current immutable object with elements that replace the content ofpreferredFormats.final JCSwapchainConfigurationwithPreferredFormats(Iterable<? extends VulkanSurfaceFormatKHR> elements) Copy the current immutable object with elements that replace the content ofpreferredFormats.final JCSwapchainConfigurationwithPreferredModes(VulkanPresentModeKHR... elements) Copy the current immutable object with elements that replace the content ofpreferredModes.final JCSwapchainConfigurationwithPreferredModes(Iterable<? extends VulkanPresentModeKHR> elements) Copy the current immutable object with elements that replace the content ofpreferredModes.final JCSwapchainConfigurationCopy the current immutable object by setting a value for thepresentationQueueattribute.final JCSwapchainConfigurationwithRequestedMinimumImages(int value) Copy the current immutable object by setting a value for therequestedMinimumImagesattribute.final JCSwapchainConfigurationCopy the current immutable object by setting a value for thesurfaceattribute.final JCSwapchainConfigurationwithSurfaceAlphaFlags(VulkanCompositeAlphaFlagKHR... elements) Copy the current immutable object with elements that replace the content ofsurfaceAlphaFlags.final JCSwapchainConfigurationCopy the current immutable object with elements that replace the content ofsurfaceAlphaFlags.final JCSwapchainConfigurationCopy the current immutable object by setting a value for thesurfaceExtensionattribute.final JCSwapchainConfigurationCopy the current immutable object by setting a value for theswapChainExtensionattribute.
-
Method Details
-
requestedMinimumImages
public int requestedMinimumImages()- Specified by:
requestedMinimumImagesin interfaceJCSwapchainConfigurationType- Returns:
- The requested minimum number of swapchain images
-
device
- Specified by:
devicein interfaceJCSwapchainConfigurationType- Returns:
- The logical device.
-
surface
- Specified by:
surfacein interfaceJCSwapchainConfigurationType- Returns:
- The KHR_surface.
-
swapChainExtension
- Specified by:
swapChainExtensionin interfaceJCSwapchainConfigurationType- Returns:
- The KHR_swapchain extension.
-
surfaceExtension
- Specified by:
surfaceExtensionin interfaceJCSwapchainConfigurationType- Returns:
- The KHR_surface extension.
-
graphicsQueue
- Specified by:
graphicsQueuein interfaceJCSwapchainConfigurationType- Returns:
- The queue used for graphics operations
-
presentationQueue
- Specified by:
presentationQueuein interfaceJCSwapchainConfigurationType- Returns:
- The queue used for presentation operations
-
preferredModes
The list of presentation modes to try in order of preference (earlier entries have higher preference).- Specified by:
preferredModesin interfaceJCSwapchainConfigurationType- Returns:
- The list of presentation modes in preference order
-
preferredFormats
The list of surface formats to try in order of preference (earlier entries have higher preference).- Specified by:
preferredFormatsin interfaceJCSwapchainConfigurationType- Returns:
- The list of surface formats in preference order
-
imageUsageFlags
- Specified by:
imageUsageFlagsin interfaceJCSwapchainConfigurationType- Returns:
- The usage flags required to be present on images returned from the swapchain
-
surfaceAlphaFlags
- Specified by:
surfaceAlphaFlagsin interfaceJCSwapchainConfigurationType- Returns:
- The required surface alpha flags
-
withRequestedMinimumImages
Copy the current immutable object by setting a value for therequestedMinimumImagesattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for requestedMinimumImages- Returns:
- A modified copy or the
thisobject
-
withDevice
Copy the current immutable object by setting a value for thedeviceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for device- Returns:
- A modified copy or the
thisobject
-
withSurface
public final JCSwapchainConfiguration withSurface(VulkanExtKHRSurfaceType.VulkanKHRSurfaceType value) Copy the current immutable object by setting a value for thesurfaceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for surface- Returns:
- A modified copy or the
thisobject
-
withSwapChainExtension
Copy the current immutable object by setting a value for theswapChainExtensionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for swapChainExtension- Returns:
- A modified copy or the
thisobject
-
withSurfaceExtension
Copy the current immutable object by setting a value for thesurfaceExtensionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for surfaceExtension- Returns:
- A modified copy or the
thisobject
-
withGraphicsQueue
Copy the current immutable object by setting a value for thegraphicsQueueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for graphicsQueue- Returns:
- A modified copy or the
thisobject
-
withPresentationQueue
Copy the current immutable object by setting a value for thepresentationQueueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for presentationQueue- Returns:
- A modified copy or the
thisobject
-
withPreferredModes
Copy the current immutable object with elements that replace the content ofpreferredModes.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withPreferredModes
public final JCSwapchainConfiguration withPreferredModes(Iterable<? extends VulkanPresentModeKHR> elements) Copy the current immutable object with elements that replace the content ofpreferredModes. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of preferredModes elements to set- Returns:
- A modified copy or
thisif not changed
-
withPreferredFormats
Copy the current immutable object with elements that replace the content ofpreferredFormats.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withPreferredFormats
public final JCSwapchainConfiguration withPreferredFormats(Iterable<? extends VulkanSurfaceFormatKHR> elements) Copy the current immutable object with elements that replace the content ofpreferredFormats. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of preferredFormats elements to set- Returns:
- A modified copy or
thisif not changed
-
withImageUsageFlags
Copy the current immutable object with elements that replace the content ofimageUsageFlags.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withImageUsageFlags
Copy the current immutable object with elements that replace the content ofimageUsageFlags. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of imageUsageFlags elements to set- Returns:
- A modified copy or
thisif not changed
-
withSurfaceAlphaFlags
public final JCSwapchainConfiguration withSurfaceAlphaFlags(VulkanCompositeAlphaFlagKHR... elements) Copy the current immutable object with elements that replace the content ofsurfaceAlphaFlags.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withSurfaceAlphaFlags
public final JCSwapchainConfiguration withSurfaceAlphaFlags(Iterable<VulkanCompositeAlphaFlagKHR> elements) Copy the current immutable object with elements that replace the content ofsurfaceAlphaFlags. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of surfaceAlphaFlags elements to set- Returns:
- A modified copy or
thisif not changed
-
equals
-
hashCode
public int hashCode()Computes a hash code from attributes:requestedMinimumImages,device,surface,swapChainExtension,surfaceExtension,graphicsQueue,presentationQueue,preferredModes,preferredFormats,imageUsageFlags,surfaceAlphaFlags. -
toString
-
copyOf
Creates an immutable copy of aJCSwapchainConfigurationTypevalue. 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 JCSwapchainConfiguration instance
-
builder
Creates a builder forJCSwapchainConfiguration.JCSwapchainConfiguration.builder() .setRequestedMinimumImages(int) // optional
requestedMinimumImages.setDevice(com.io7m.jcoronado.api.VulkanLogicalDeviceType) // requireddevice.setSurface(com.io7m.jcoronado.extensions.khr_surface.api.VulkanExtKHRSurfaceType.VulkanKHRSurfaceType) // requiredsurface.setSwapChainExtension(com.io7m.jcoronado.extensions.khr_swapchain.api.VulkanExtKHRSwapChainType) // requiredswapChainExtension.setSurfaceExtension(com.io7m.jcoronado.extensions.khr_surface.api.VulkanExtKHRSurfaceType) // requiredsurfaceExtension.setGraphicsQueue(com.io7m.jcoronado.api.VulkanQueueType) // requiredgraphicsQueue.setPresentationQueue(com.io7m.jcoronado.api.VulkanQueueType) // requiredpresentationQueue.addPreferredModes|addAllPreferredModes(com.io7m.jcoronado.extensions.khr_swapchain.api.VulkanPresentModeKHR) //preferredModeselements .addPreferredFormats|addAllPreferredFormats(com.io7m.jcoronado.extensions.khr_surface.api.VulkanSurfaceFormatKHR) //preferredFormatselements .addImageUsageFlags|addAllImageUsageFlags(com.io7m.jcoronado.api.VulkanImageUsageFlag) //imageUsageFlagselements .addSurfaceAlphaFlags|addAllSurfaceAlphaFlags(com.io7m.jcoronado.extensions.khr_swapchain.api.VulkanCompositeAlphaFlagKHR) //surfaceAlphaFlagselements .build();- Returns:
- A new JCSwapchainConfiguration builder
-