Record Class WGPUSurfaceConfiguration
java.lang.Object
java.lang.Record
club.doki7.webgpu.datatype.WGPUSurfaceConfiguration
- All Implemented Interfaces:
IPointer,IWGPUSurfaceConfiguration
@ValueBasedCandidate
@UnsafeConstructor
public record WGPUSurfaceConfiguration(@NotNull MemorySegment segment)
extends Record
implements IWGPUSurfaceConfiguration
Represents a pointer to a WGPUSurfaceConfiguration structure in native memory.
Structure
typedef struct WGPUSurfaceConfiguration {
WGPUChainedStruct const* nextInChain; // optional
WGPUDevice device;
WGPUTextureFormat format;
WGPUTextureUsage usage;
uint32_t width;
uint32_t height;
size_t viewFormatCount;
WGPUTextureFormat const* viewFormats;
WGPUCompositeAlphaMode alphaMode;
WGPUPresentMode presentMode;
} WGPUSurfaceConfiguration;
Contracts
The property segment() should always be not-null
(segment != NULL && !segment.equals(MemorySegment.NULL)), and properly aligned to
LAYOUT.byteAlignment() bytes. To represent null pointer, you may use a Java
null instead. See the documentation of IPointer.segment() for more details.
The constructor of this class is marked as UnsafeConstructor, because it does not
perform any runtime check. The constructor can be useful for automatic code generators.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final StructLayoutstatic final ValueLayout.OfIntstatic final AddressLayoutstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final AddressLayoutstatic final ValueLayout.OfIntstatic final ValueLayout.OfLongstatic final AddressLayoutstatic final ValueLayout.OfIntstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionWGPUSurfaceConfiguration(@NotNull MemorySegment segment) Creates an instance of aWGPUSurfaceConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic WGPUSurfaceConfigurationstatic WGPUSurfaceConfiguration.PtrintalphaMode(int value) static WGPUSurfaceConfigurationclone(Arena arena, WGPUSurfaceConfiguration src) @Nullable WGPUDevicedevice()device(@Nullable WGPUDevice value) final booleanIndicates whether some other object is "equal to" this one.intformat()format(int value) final inthashCode()Returns a hash code value for this object.intheight()height(int value) @Nullable WGPUChainedStructnextInChain(int assumedCount) nextInChain(@Nullable IWGPUChainedStruct value) @NotNull MemorySegmentvoidnextInChainRaw(@NotNull MemorySegment value) intpresentMode(int value) @NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.final StringtoString()Returns a string representation of this record class.longusage()usage(long value) longviewFormatCount(long value) @Nullable IntPtrNote: the returnedIntPtrdoes not have correctIntPtr.size()property.viewFormats(@Nullable IntPtr value) @NotNull MemorySegmentvoidviewFormatsRaw(@NotNull MemorySegment value) intwidth()width(int value)
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$nextInChain
-
PATH$device
-
PATH$format
-
PATH$usage
-
PATH$width
-
PATH$height
-
PATH$viewFormatCount
-
PATH$viewFormats
-
PATH$alphaMode
-
PATH$presentMode
-
LAYOUT$nextInChain
-
LAYOUT$device
-
LAYOUT$format
-
LAYOUT$usage
-
LAYOUT$width
-
LAYOUT$height
-
LAYOUT$viewFormats
-
LAYOUT$alphaMode
-
LAYOUT$presentMode
-
SIZE$nextInChain
public static final long SIZE$nextInChain -
SIZE$device
public static final long SIZE$device -
SIZE$format
public static final long SIZE$format -
SIZE$usage
public static final long SIZE$usage -
SIZE$width
public static final long SIZE$width -
SIZE$height
public static final long SIZE$height -
SIZE$viewFormatCount
public static final long SIZE$viewFormatCount -
SIZE$viewFormats
public static final long SIZE$viewFormats -
SIZE$alphaMode
public static final long SIZE$alphaMode -
SIZE$presentMode
public static final long SIZE$presentMode -
OFFSET$nextInChain
public static final long OFFSET$nextInChain -
OFFSET$device
public static final long OFFSET$device -
OFFSET$format
public static final long OFFSET$format -
OFFSET$usage
public static final long OFFSET$usage -
OFFSET$width
public static final long OFFSET$width -
OFFSET$height
public static final long OFFSET$height -
OFFSET$viewFormatCount
public static final long OFFSET$viewFormatCount -
OFFSET$viewFormats
public static final long OFFSET$viewFormats -
OFFSET$alphaMode
public static final long OFFSET$alphaMode -
OFFSET$presentMode
public static final long OFFSET$presentMode
-
-
Constructor Details
-
WGPUSurfaceConfiguration
Creates an instance of aWGPUSurfaceConfigurationrecord class.- Parameters:
segment- the value for thesegmentrecord component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
nextInChain
-
nextInChain
-
nextInChain
-
nextInChainRaw
-
nextInChainRaw
public void nextInChainRaw(@Pointer(target=WGPUChainedStruct.class) @NotNull @NotNull MemorySegment value) -
device
-
device
-
format
-
format
-
usage
-
usage
-
width
-
width
-
height
-
height
-
viewFormatCount
-
viewFormatCount
-
viewFormats
Note: the returnedIntPtrdoes not have correctIntPtr.size()property. It's up to user to track the size of the buffer, and useIntPtr.reinterpret(long)to set the size before actually reading fro or writing to the buffer. -
viewFormats
public WGPUSurfaceConfiguration viewFormats(@Nullable @EnumType(WGPUTextureFormat.class) @Nullable IntPtr value) -
viewFormatsRaw
-
viewFormatsRaw
public void viewFormatsRaw(@Pointer(target=WGPUTextureFormat.class) @NotNull @NotNull MemorySegment value) -
alphaMode
-
alphaMode
-
presentMode
-
presentMode
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
segment
Returns the value of thesegmentrecord component.
-