Package heronarts.glx

Class DynamicIndexBuffer

java.lang.Object
heronarts.glx.DynamicIndexBuffer

public class DynamicIndexBuffer extends Object
A bgfx index buffer with contents that can be updated dynamically between frames.
  • Constructor Details

    • DynamicIndexBuffer

      public DynamicIndexBuffer(GLX glx, int numIndices)
      Constructs a new dynamic index buffer
      Parameters:
      glx - GLX instance
      numIndices - How many indices are in the buffer (number of indices, not bytes)
    • DynamicIndexBuffer

      public DynamicIndexBuffer(GLX glx, int numIndices, boolean int32)
      Constructs a new dynamic index buffer
      Parameters:
      glx - GLX instance
      numIndices - How many indices are in the buffer (number of indices, not bytes)
      int32 - Whether to use int32 size rather than int16 for index references (for large buffers > 65K)
  • Method Details

    • getHandle

      public short getHandle()
      Returns the bgfx handle for the vertex buffer
      Returns:
      BGFX buffer handle
    • getNumIndices

      public int getNumIndices()
      Returns the number of indices in the buffer
      Returns:
      Number of indices in the buffer (numeric count, not bytes)
    • getIndexData

      public ByteBuffer getIndexData()
      Returns the raw data buffer used to populate the buffer
      Returns:
      Raw data buffer
    • update

      public void update()
      Update the underlying BGFX index buffer with the index buffer data
    • dispose

      public void dispose()
      Clean up this component, free all memory resources