Class VertexBufferObject

java.lang.Object
dev.prozilla.pine.core.rendering.VertexBufferObject
All Implemented Interfaces:
Destructible

public class VertexBufferObject extends Object implements Destructible
Represents a Vertex Buffer Object (VBO).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a Vertex Buffer Object (VBO).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bind(int target)
    Binds this VBO with specified target.
    void
    Deletes this VBO.
    int
    Getter for the Vertex Buffer Object ID.
    void
    uploadData(int target, long size, int usage)
    Upload null data to this VBO with specified target, size and usage.
    void
    uploadData(int target, FloatBuffer data, int usage)
    Upload vertex data to this VBO with specified target, data and usage.
    void
    uploadData(int target, IntBuffer data, int usage)
    Upload element data to this EBO with specified target, data and usage.
    void
    uploadSubData(int target, long offset, FloatBuffer data)
    Upload sub data to this VBO with specified target, offset and data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VertexBufferObject

      public VertexBufferObject()
      Creates a Vertex Buffer Object (VBO).
  • Method Details

    • bind

      public void bind(int target)
      Binds this VBO with specified target. The target in the tutorial should be GL_ARRAY_BUFFER most of the time.
      Parameters:
      target - Target to bind
    • uploadData

      public void uploadData(int target, FloatBuffer data, int usage)
      Upload vertex data to this VBO with specified target, data and usage. The target in the tutorial should be GL_ARRAY_BUFFER and usage should be GL_STATIC_DRAW most of the time.
      Parameters:
      target - Target to upload
      data - Buffer with the data to upload
      usage - Usage of the data
    • uploadData

      public void uploadData(int target, long size, int usage)
      Upload null data to this VBO with specified target, size and usage. The target in the tutorial should be GL_ARRAY_BUFFER and usage should be GL_STATIC_DRAW most of the time.
      Parameters:
      target - Target to upload
      size - Size in bytes of the VBO data store
      usage - Usage of the data
    • uploadSubData

      public void uploadSubData(int target, long offset, FloatBuffer data)
      Upload sub data to this VBO with specified target, offset and data. The target in the tutorial should be GL_ARRAY_BUFFER most of the time.
      Parameters:
      target - Target to upload
      offset - Offset where the data should go in bytes
      data - Buffer with the data to upload
    • uploadData

      public void uploadData(int target, IntBuffer data, int usage)
      Upload element data to this EBO with specified target, data and usage. The target in the tutorial should be GL_ELEMENT_ARRAY_BUFFER and usage should be GL_STATIC_DRAW most of the time.
      Parameters:
      target - Target to upload
      data - Buffer with the data to upload
      usage - Usage of the data
    • destroy

      public void destroy()
      Deletes this VBO.
      Specified by:
      destroy in interface Destructible
    • getId

      public int getId()
      Getter for the Vertex Buffer Object ID.
      Returns:
      Handle of the VBO