Package de.coreengine.util.gl
Class VertexArrayObject
- java.lang.Object
-
- de.coreengine.util.gl.VertexArrayObject
-
public class VertexArrayObject extends Object
Class that represent an opengl vao- Author:
- Darius Dinger
-
-
Constructor Summary
Constructors Constructor Description VertexArrayObject()
Creates new VertexArrayObject and generate one in opengl
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexBuffer
addIndexBuffer(int[] indices)
Creates new IndexBuffer and adding it to the vaoint
addInstancedVertexBuffer(int maxInstances, int dimension, int firstRow, int rowCount)
Adding a vertex buffer, that change sper instance.void
addVertexBuffer(float[] values, int dimension, int row)
Adding new VertexBufferObject (VBO) to the VAOvoid
addVertexBuffer(int[] values, int dimension, int row)
Adding new VertexBufferObject (VBO) to the VAOvoid
bind()
Bind VAO to openglvoid
disableAttribute(int row)
Disable specific row of the VAOvoid
disableAttributes()
Disable all rows of the VAOvoid
enableAttribute(int row)
Enable specific row of the VAOvoid
enableAttributes()
Enable all rows of the VAOvoid
unbind()
Unbind VAO from opengl (bind 0)
-
-
-
Method Detail
-
addVertexBuffer
public void addVertexBuffer(float[] values, int dimension, int row)
Adding new VertexBufferObject (VBO) to the VAO- Parameters:
values
- Values to fill into the bufferdimension
- Dimension of the valuesrow
- Row to store the buffer in the vao
-
addVertexBuffer
public void addVertexBuffer(int[] values, int dimension, int row)
Adding new VertexBufferObject (VBO) to the VAO- Parameters:
values
- Values to fill into the bufferdimension
- Dimension of the valuesrow
- Row to store the buffer in the vao
-
addIndexBuffer
public IndexBuffer addIndexBuffer(int[] indices)
Creates new IndexBuffer and adding it to the vao- Parameters:
indices
- Indices for the new index buffer- Returns:
- IndexBuffer that was created
-
addInstancedVertexBuffer
public int addInstancedVertexBuffer(int maxInstances, int dimension, int firstRow, int rowCount)
Adding a vertex buffer, that change sper instance.- Parameters:
maxInstances
- Max instances of the vao per render calldimension
- Dimension of the instanced datafirstRow
- First row of the instanced datarowCount
- Count of rows of the instanced data- Returns:
- VBO id of the instanced vertex buffer
-
enableAttributes
public void enableAttributes()
Enable all rows of the VAO
-
enableAttribute
public void enableAttribute(int row)
Enable specific row of the VAO- Parameters:
row
- Row to enable
-
disableAttributes
public void disableAttributes()
Disable all rows of the VAO
-
disableAttribute
public void disableAttribute(int row)
Disable specific row of the VAO- Parameters:
row
- Row to disable
-
bind
public void bind()
Bind VAO to opengl
-
unbind
public final void unbind()
Unbind VAO from opengl (bind 0)
-
-