Record Class StaticGPUBuffer
java.lang.Object
java.lang.Record
dev.pfaff.altargui.render.objects.StaticGPUBuffer
- All Implemented Interfaces:
RenderObject
,Uploadable
,AutoCloseable
public record StaticGPUBuffer(int program, int id, MemoryLayout instanceLayout, int instanceCount)
extends Record
implements RenderObject
Might be optimal for large amounts of data. Testing will be needed to confirm this and establish a rough threshold.
-
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
ConstructorsConstructorDescriptionStaticGPUBuffer
(int program, int id, MemoryLayout instanceLayout, int instanceCount) Creates an instance of aStaticGPUBuffer
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic StaticGPUBuffer
build
(int layer, MemoryLayout instanceLayout, int instanceCount, Consumer<? super Sink> 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
id()
Returns the value of theid
record component.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
-
StaticGPUBuffer
Creates an instance of aStaticGPUBuffer
record class.- Parameters:
program
- the value for theprogram
record componentid
- the value for theid
record componentinstanceLayout
- the value for theinstanceLayout
record componentinstanceCount
- the value for theinstanceCount
record component
-
-
Method Details
-
build
public static StaticGPUBuffer build(int layer, MemoryLayout instanceLayout, int instanceCount, Consumer<? super Sink> builder) -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceRenderObject
-
uploadTo
- Specified by:
uploadTo
in interfaceUploadable
-
uSpecUploadAtUnchecked
- Specified by:
uSpecUploadAtUnchecked
in interfaceUploadable
-
uSpecUploadCanvas
- Specified by:
uSpecUploadCanvas
in interfaceRenderObject
-
uSpecUploadLayered
- Specified by:
uSpecUploadLayered
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
-
id
public int id()Returns the value of theid
record component.- Returns:
- the value of the
id
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
-