org.osm2world.core.target.jogl
public abstract class VBOData<BufferT extends Buffer> extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
glValueType
gl constant for the value type in the vbo
|
protected int[] |
id
array with one element containing the VBO id
|
protected Material |
material
material associated with this VBO, determines VBO layout
|
protected JOGLTextureManager |
textureManager |
protected int |
valueTypeSize
size of each value in the vbo
|
protected int |
vertexCount
number of vertices in the vbo
|
Constructor and Description |
---|
VBOData(GL gl,
JOGLTextureManager textureManager,
Material material,
Collection<Primitive> primitives)
Creates a new vertex buffer object, adds all primitives to the buffer and uploads it to graphics memory.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addPrimitiveToValueBuffer(BufferT buffer,
Primitive primitive)
put the values for a primitive's vertices into the buffer
|
protected abstract BufferT |
createBuffer(int numValues)
create a buffer to store the vbo data for upload to graphics memory
|
void |
delete()
Delete the vertex buffer object from graphics memory.
|
protected abstract int |
getValuesPerVertex(Material material)
Returns the number of values for each vertex in the vertex buffer layout appropriate for a given material.
|
protected abstract int |
glValueType()
returns the gl constant for the value type in the vbo
|
protected abstract void |
put(BufferT buffer,
VectorXYZ v)
add 3d vertex data to the vbo buffer
|
protected abstract void |
put(BufferT buffer,
VectorXZ texCoord)
add a texture coordinate to the vbo buffer
|
abstract void |
render()
Bind and render this vertex buffer object.
|
protected abstract int |
valueTypeSize()
returns the size of each value in the vbo
|
protected Material material
protected final int[] id
protected final int vertexCount
protected final int valueTypeSize
protected final int glValueType
protected JOGLTextureManager textureManager
public VBOData(GL gl, JOGLTextureManager textureManager, Material material, Collection<Primitive> primitives)
protected abstract BufferT createBuffer(int numValues)
protected abstract void put(BufferT buffer, VectorXZ texCoord)
protected abstract int valueTypeSize()
protected abstract int glValueType()
protected void addPrimitiveToValueBuffer(BufferT buffer, Primitive primitive)
public abstract void render()
protected abstract int getValuesPerVertex(Material material)
public void delete()