Class RawBuffer

java.lang.Object
dev.pfaff.altargui.render.RawBuffer
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
AbstractMappedBuffer, ViaBufferSubDataBuffer, ViaIntermediateBuffer

public abstract class RawBuffer extends Object implements Closeable
  • Field Details

    • bindTarget

      protected final dev.pfaff.glass.opengl.enums.GLBufferTarget bindTarget
  • Constructor Details

    • RawBuffer

      public RawBuffer(dev.pfaff.glass.opengl.enums.GLBufferTarget bindTarget)
      Parameters:
      bindTarget - where the buffer will be bound.
  • Method Details

    • create

      public static RawBuffer create(dev.pfaff.glass.opengl.enums.GLBufferTarget bindTarget, boolean isShared)
    • bind

      public final void bind()
    • unbind

      public final void unbind()
    • growBuffer

      protected abstract void growBuffer(int capacity, Runnable onRecreate)
      Grows the buffer to at least the specified capacity. The buffer's contents are undefined after this operation.
    • resetNoGrow

      protected abstract void resetNoGrow()
    • reset

      public final void reset(int capacity, Runnable onRecreate)
      Parameters:
      capacity - the required capacity in instances.
    • beginUploading

      public void beginUploading()
      Begins uploading to the buffer. Attempts to upload more than capacity might result in a BufferOverflowException being thrown.

      The buffer's contents are undefined after this operation.

    • finishUploading

      public void finishUploading()
    • isBoundDuringUpload

      public abstract boolean isBoundDuringUpload()
    • boundIfNotAlreadyDuringUpload

      public final InfallibleAutoClosable boundIfNotAlreadyDuringUpload()
    • checkCompleteUpload

      protected final void checkCompleteUpload(long uploaded, Uploadable uploadable)
    • uploadAtUnchecked

      protected abstract void uploadAtUnchecked(long offset, Uploadable uploadable)
    • uploadAt

      public final void uploadAt(long offset, Uploadable uploadable)
    • upload

      public final void upload(Uploadable uploadable)
    • id

      public abstract int id()
    • length

      public final int length()
    • setLength

      public final void setLength(int length)
      Unsafe.
    • capacity

      public abstract int capacity()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • dump

      public void dump(String label, boolean capacity)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable