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 record
Represents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final StructLayout
static final ValueLayout.OfInt
static final AddressLayout
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final AddressLayout
static final ValueLayout.OfInt
static final ValueLayout.OfLong
static final AddressLayout
static final ValueLayout.OfInt
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionWGPUSurfaceConfiguration
(@NotNull MemorySegment segment) Creates an instance of aWGPUSurfaceConfiguration
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic WGPUSurfaceConfiguration
static WGPUSurfaceConfiguration.Ptr
int
alphaMode
(int value) static WGPUSurfaceConfiguration
clone
(Arena arena, WGPUSurfaceConfiguration src) @Nullable WGPUDevice
device()
device
(@Nullable WGPUDevice value) final boolean
Indicates whether some other object is "equal to" this one.int
format()
format
(int value) final int
hashCode()
Returns a hash code value for this object.int
height()
height
(int value) @Nullable WGPUChainedStruct
nextInChain
(int assumedCount) nextInChain
(@Nullable IWGPUChainedStruct value) @NotNull MemorySegment
void
nextInChainRaw
(@NotNull MemorySegment value) int
presentMode
(int value) @NotNull MemorySegment
segment()
Returns the value of thesegment
record component.final String
toString()
Returns a string representation of this record class.long
usage()
usage
(long value) long
viewFormatCount
(long value) @Nullable IntPtr
Note: the returnedIntPtr
does not have correctIntPtr.size()
property.viewFormats
(@Nullable IntPtr value) @NotNull MemorySegment
void
viewFormatsRaw
(@NotNull MemorySegment value) int
width()
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 aWGPUSurfaceConfiguration
record class.- Parameters:
segment
- the value for thesegment
record 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 returnedIntPtr
does 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 thesegment
record component.
-