Class VulkanSwapChainImageAcquisition
java.lang.Object
com.io7m.jcoronado.extensions.khr_swapchain.api.VulkanSwapChainImageAcquisition
- All Implemented Interfaces:
VulkanSwapChainImageAcquisitionType
public final class VulkanSwapChainImageAcquisition
extends Object
implements VulkanSwapChainImageAcquisitionType
The result of an attempt to acquire an image from the swap chain.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeVulkanSwapChainImageAcquisition. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forVulkanSwapChainImageAcquisition.copyOf(VulkanSwapChainImageAcquisitionType instance) Creates an immutable copy of aVulkanSwapChainImageAcquisitionTypevalue.booleanThis instance is equal to all instances ofVulkanSwapChainImageAcquisitionthat have equal attribute values.inthashCode()Computes a hash code from attributes:imageIndex,subOptimal,timedOut.of(OptionalInt imageIndex, boolean subOptimal, boolean timedOut) Construct a new immutableVulkanSwapChainImageAcquisitioninstance.booleanIf an image became available, and the swapchain no longer matches the surface properties exactly but can still be used to present to the surface successfully, this method will returntrue.booleantimedOut()toString()Prints the immutable valueVulkanSwapChainImageAcquisitionwith attribute values.withImageIndex(int value) Copy the current immutable object by setting a present value for the optionalimageIndexattribute.withImageIndex(OptionalInt optional) Copy the current immutable object by setting an optional value for theimageIndexattribute.withSubOptimal(boolean value) Copy the current immutable object by setting a value for thesubOptimalattribute.withTimedOut(boolean value) Copy the current immutable object by setting a value for thetimedOutattribute.
-
Method Details
-
imageIndex
- Specified by:
imageIndexin interfaceVulkanSwapChainImageAcquisitionType- Returns:
- The index of the acquired image in the swapchain
-
subOptimal
public boolean subOptimal()If an image became available, and the swapchain no longer matches the surface properties exactly but can still be used to present to the surface successfully, this method will returntrue.- Specified by:
subOptimalin interfaceVulkanSwapChainImageAcquisitionType- Returns:
trueif the image is now suboptimal
-
timedOut
public boolean timedOut()- Specified by:
timedOutin interfaceVulkanSwapChainImageAcquisitionType- Returns:
trueiff a timeout was specified and no image was available within that time
-
withImageIndex
Copy the current immutable object by setting a present value for the optionalimageIndexattribute.- Parameters:
value- The value for imageIndex- Returns:
- A modified copy of
thisobject
-
withImageIndex
Copy the current immutable object by setting an optional value for theimageIndexattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for imageIndex- Returns:
- A modified copy of
thisobject
-
withSubOptimal
Copy the current immutable object by setting a value for thesubOptimalattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for subOptimal- Returns:
- A modified copy of the
thisobject
-
withTimedOut
Copy the current immutable object by setting a value for thetimedOutattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for timedOut- Returns:
- A modified copy of the
thisobject
-
equals
-
hashCode
-
toString
-
of
public static VulkanSwapChainImageAcquisition of(OptionalInt imageIndex, boolean subOptimal, boolean timedOut) Construct a new immutableVulkanSwapChainImageAcquisitioninstance.- Parameters:
imageIndex- The value for theimageIndexattributesubOptimal- The value for thesubOptimalattributetimedOut- The value for thetimedOutattribute- Returns:
- An immutable VulkanSwapChainImageAcquisition instance
-
copyOf
Creates an immutable copy of aVulkanSwapChainImageAcquisitionTypevalue. 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 VulkanSwapChainImageAcquisition instance
-
builder
Creates a builder forVulkanSwapChainImageAcquisition.VulkanSwapChainImageAcquisition.builder() .setImageIndex(int) // optionalimageIndex.setSubOptimal(boolean) // requiredsubOptimal.setTimedOut(boolean) // requiredtimedOut.build();- Returns:
- A new VulkanSwapChainImageAcquisition builder
-