Class AbstractBufferData<T extends Buffer>

java.lang.Object
com.ardor3d.scenegraph.AbstractBufferData<T>
Direct Known Subclasses:
FloatBufferData, IndexBufferData

public abstract class AbstractBufferData<T extends Buffer> extends Object
  • Field Details

  • Method Details

    • getByteCount

      public abstract int getByteCount()
      Returns:
      the number of bytes per entry in the buffer. For example, an IntBuffer would return 4.
    • getBufferLimit

      public int getBufferLimit()
      Gets the count.
      Returns:
      the count
    • getBufferCapacity

      public int getBufferCapacity()
      Gets the count.
      Returns:
      the count
    • getBuffer

      public T getBuffer()
      Get the buffer holding the data.
      Returns:
      the buffer
    • setBuffer

      public void setBuffer(T buffer)
      Set the buffer holding the data.
      Parameters:
      buffer - the buffer to set
    • getVBOID

      public int getVBOID(Object glContext)
      Parameters:
      glContext - the object representing the OpenGL context a vbo belongs to. See RenderContext.getGlContextRep()
      Returns:
      the vbo id of a vbo in the given context. If the vbo is not found in the given context, 0 is returned.
    • removeVBOID

      public int removeVBOID(Object glContext)
      Removes any vbo id from this buffer's data for the given OpenGL context.
      Parameters:
      glContext - the object representing the OpenGL context a vbo would belong to. See RenderContext.getGlContextRep()
      Returns:
      the id removed or 0 if not found.
    • setVBOID

      public void setVBOID(Object glContextRep, int vboId)
      Sets the id for a vbo based on this buffer's data in regards to the given OpenGL context.
      Parameters:
      glContextRep - the object representing the OpenGL context a vbo belongs to. See RenderContext.getGlContextRep()
      vboId - the vbo id of a vbo. To be valid, this must be not equals to 0.
      Throws:
      IllegalArgumentException - if vboId is less than or equal to 0.
    • getVboAccessMode

      public AbstractBufferData.VBOAccessMode getVboAccessMode()
    • setVboAccessMode

      public void setVboAccessMode(AbstractBufferData.VBOAccessMode vboAccessMode)
    • isNeedsRefresh

      public boolean isNeedsRefresh()
    • setNeedsRefresh

      public void setNeedsRefresh(boolean needsRefresh)
    • cleanAllVBOs

      public static void cleanAllVBOs(Renderer deleter)
    • cleanAllVBOs

      public static void cleanAllVBOs(Renderer deleter, RenderContext context)
    • cleanExpiredVBOs

      public static void cleanExpiredVBOs(Renderer deleter)
      Clean any VBO ids from the hardware, using the given Renderer object to do the work immediately, if given. If not, we will delete in the next execution of the appropriate context's game task render queue.
      Parameters:
      deleter - the Renderer to use. If null, execution will not occur immediately.
    • makeCopy

      public abstract AbstractBufferData<T> makeCopy()
      Returns:
      a deep copy of this buffer data object
    • read

      public void read(InputCapsule capsule) throws IOException
      Throws:
      IOException
    • write

      public void write(OutputCapsule capsule) throws IOException
      Throws:
      IOException