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.
  • Constructor Details

    • StaticGPUBuffer

      public StaticGPUBuffer(int program, int id, MemoryLayout instanceLayout, int instanceCount)
      Creates an instance of a StaticGPUBuffer record class.
      Parameters:
      program - the value for the program record component
      id - the value for the id record component
      instanceLayout - the value for the instanceLayout record component
      instanceCount - the value for the instanceCount 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 interface AutoCloseable
      Specified by:
      close in interface RenderObject
    • uploadTo

      public void uploadTo(Sink sink)
      Specified by:
      uploadTo in interface Uploadable
    • uSpecUploadAtUnchecked

      public void uSpecUploadAtUnchecked(ViaIntermediateBuffer buffer, long offset)
      Specified by:
      uSpecUploadAtUnchecked in interface Uploadable
    • uSpecUploadCanvas

      public void uSpecUploadCanvas(CanvasImpl canvas)
      Specified by:
      uSpecUploadCanvas in interface RenderObject
    • uSpecUploadLayered

      public void uSpecUploadLayered(LayeredRenderBuffer buffer)
      Specified by:
      uSpecUploadLayered in interface RenderObject
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • program

      public int program()
      Returns the value of the program record component.
      Specified by:
      program in interface RenderObject
      Returns:
      the value of the program record component
    • id

      public int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • instanceLayout

      public MemoryLayout instanceLayout()
      Returns the value of the instanceLayout record component.
      Specified by:
      instanceLayout in interface RenderObject
      Returns:
      the value of the instanceLayout record component
    • instanceCount

      public int instanceCount()
      Returns the value of the instanceCount record component.
      Specified by:
      instanceCount in interface RenderObject
      Returns:
      the value of the instanceCount record component