Class UnifiedRenderBuffer

java.lang.Object
dev.pfaff.altargui.render.AbstractVertexArrayObject
dev.pfaff.altargui.render.UnifiedRenderBuffer
All Implemented Interfaces:
Closeable, AutoCloseable

public final class UnifiedRenderBuffer extends AbstractVertexArrayObject
A reusable buffer for unified rendering. Every rendered element is made up of triangles. The entire scene is emitted to a single buffer and then rendered with a single draw call.
  • Field Details

    • VERTEX_SPEC

      public static final InstanceLayout VERTEX_SPEC
    • verticesBuffer

      public final Buffer verticesBuffer
  • Constructor Details

    • UnifiedRenderBuffer

      public UnifiedRenderBuffer()
  • Method Details

    • beginUploadingInstances

      public void beginUploadingInstances(int capacity)
    • finishUploadingInstances

      public void finishUploadingInstances()
    • uploadInstance

      public void uploadInstance(Uploadable uploadable)
      Uploads an instance to the buffer. beginUploadingInstances(int) must have been called already.
    • preDraw

      public void preDraw()
    • postDraw

      public void postDraw()
    • draw

      public void draw()
      This calls preDraw() and postDraw() for you.
    • drawRange

      public void drawRange(int first, int count)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class AbstractVertexArrayObject
    • instanceCount

      public int instanceCount()
    • byteCount

      public int byteCount()