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

    • StaticCPUBuffer

      public StaticCPUBuffer(int program, byte[] buffer, MemoryLayout instanceLayout, int instanceCount)
      Creates an instance of a StaticCPUBuffer record class.
      Parameters:
      program - the value for the program record component
      buffer - the value for the buffer record component
      instanceLayout - the value for the instanceLayout record component
      instanceCount - the value for the instanceCount record component
  • Method Details

    • build

      public static StaticCPUBuffer build(int layer, MemoryLayout instanceLayout, int instanceCount, Consumer<? super ByteBufferSink> builder)
    • 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
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close 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
    • buffer

      public byte[] buffer()
      Returns the value of the buffer record component.
      Returns:
      the value of the buffer 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