Record Class StaticCPUBuffer
java.lang.Object
java.lang.Record
dev.pfaff.altargui.render.objects.StaticCPUBuffer
- All Implemented Interfaces:
RenderObject
,Uploadable
,AutoCloseable
public record StaticCPUBuffer(int program, byte[] buffer, MemoryLayout instanceLayout, int instanceCount)
extends Record
implements RenderObject
-
Field Summary
Fields inherited from interface dev.pfaff.altargui.render.RenderObject
EMPTY_ARRAY
Fields inherited from interface dev.pfaff.altargui.uploadables.Uploadable
POSITION_LAYOUT, POSITION_PACKED_LAYOUT, UV_LAYOUT, UV_PACKED_LAYOUT, VERTEX_LAYOUT
-
Constructor Summary
ConstructorsConstructorDescriptionStaticCPUBuffer
(int program, byte[] buffer, MemoryLayout instanceLayout, int instanceCount) Creates an instance of aStaticCPUBuffer
record class. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
buffer()
Returns the value of thebuffer
record component.static StaticCPUBuffer
build
(int layer, MemoryLayout instanceLayout, int instanceCount, Consumer<? super ByteBufferSink> builder) void
close()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of theinstanceCount
record component.Returns the value of theinstanceLayout
record component.int
program()
Returns the value of theprogram
record component.final String
toString()
Returns a string representation of this record class.void
void
uSpecUploadAtUnchecked
(ViaIntermediateBuffer buffer, long offset) void
uSpecUploadCanvas
(CanvasImpl canvas) void
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface dev.pfaff.altargui.render.RenderObject
size
-
Constructor Details
-
StaticCPUBuffer
Creates an instance of aStaticCPUBuffer
record class.- Parameters:
program
- the value for theprogram
record componentbuffer
- the value for thebuffer
record componentinstanceLayout
- the value for theinstanceLayout
record componentinstanceCount
- the value for theinstanceCount
record component
-
-
Method Details
-
build
public static StaticCPUBuffer build(int layer, MemoryLayout instanceLayout, int instanceCount, Consumer<? super ByteBufferSink> builder) -
uploadTo
- Specified by:
uploadTo
in interfaceUploadable
-
uSpecUploadAtUnchecked
- Specified by:
uSpecUploadAtUnchecked
in interfaceUploadable
-
uSpecUploadCanvas
- Specified by:
uSpecUploadCanvas
in interfaceRenderObject
-
uSpecUploadLayered
- Specified by:
uSpecUploadLayered
in interfaceRenderObject
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceRenderObject
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
program
public int program()Returns the value of theprogram
record component.- Specified by:
program
in interfaceRenderObject
- Returns:
- the value of the
program
record component
-
buffer
public byte[] buffer()Returns the value of thebuffer
record component.- Returns:
- the value of the
buffer
record component
-
instanceLayout
Returns the value of theinstanceLayout
record component.- Specified by:
instanceLayout
in interfaceRenderObject
- Returns:
- the value of the
instanceLayout
record component
-
instanceCount
public int instanceCount()Returns the value of theinstanceCount
record component.- Specified by:
instanceCount
in interfaceRenderObject
- Returns:
- the value of the
instanceCount
record component
-