Package dev.prozilla.pine.core.rendering
Class VertexBufferObject
java.lang.Object
dev.prozilla.pine.core.rendering.VertexBufferObject
- All Implemented Interfaces:
Destructible
Represents a Vertex Buffer Object (VBO).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(int target) Binds this VBO with specified target.voidbind(VertexBufferObject.Target target) voiddestroy()Deletes this VBO.static intintgetId()Getter for the Vertex Buffer Object ID.booleanisBound()voiduploadData(int target, long size, int usage) Upload null data to this VBO with specified target, size and usage.voiduploadData(int target, FloatBuffer data, int usage) Upload vertex data to this VBO with specified target, data and usage.voiduploadData(int target, IntBuffer data, int usage) Upload element data to this EBO with specified target, data and usage.voiduploadData(VertexBufferObject.Target target, long size, VertexBufferObject.Usage usage) voiduploadData(VertexBufferObject.Target target, FloatBuffer data, VertexBufferObject.Usage usage) voiduploadData(VertexBufferObject.Target target, IntBuffer data, VertexBufferObject.Usage usage) voiduploadSubData(int target, long offset, FloatBuffer data) Upload sub data to this VBO with specified target, offset and data.voiduploadSubData(VertexBufferObject.Target target, long offset, FloatBuffer data)
-
Constructor Details
-
VertexBufferObject
public VertexBufferObject()Creates a Vertex Buffer Object (VBO).
-
-
Method Details
-
bind
-
bind
public void bind(int target) Binds this VBO with specified target.- Parameters:
target- Target to bind
-
uploadData
public void uploadData(VertexBufferObject.Target target, FloatBuffer data, VertexBufferObject.Usage usage) -
uploadData
Upload vertex data to this VBO with specified target, data and usage.- Parameters:
target- Target to uploaddata- Buffer with the data to uploadusage- Usage of the data
-
uploadData
-
uploadData
public void uploadData(int target, long size, int usage) Upload null data to this VBO with specified target, size and usage.- Parameters:
target- Target to uploadsize- Size in bytes of the VBO data storeusage- Usage of the data
-
uploadSubData
-
uploadSubData
Upload sub data to this VBO with specified target, offset and data.- Parameters:
target- Target to uploadoffset- Offset where the data should go in bytesdata- Buffer with the data to upload
-
uploadData
public void uploadData(VertexBufferObject.Target target, IntBuffer data, VertexBufferObject.Usage usage) -
uploadData
Upload element data to this EBO with specified target, data and usage.- Parameters:
target- Target to uploaddata- Buffer with the data to uploadusage- Usage of the data
-
destroy
public void destroy()Deletes this VBO.- Specified by:
destroyin interfaceDestructible
-
getId
public int getId()Getter for the Vertex Buffer Object ID.- Returns:
- Handle of the VBO
-
isBound
public boolean isBound() -
getBoundId
public static int getBoundId()
-