Maven module :un.engine : engine-opengl-util :
Class : un.impl.opengl.resource.TBO
Extends/Implements : un.impl.opengl.resource.AbstractResource
Subclasses : -

Texture Buffer Object resource.
https://www.opengl.org/wiki/Buffer_Texture
author  Johann Sorel


Variables : -
Functions : TBO, TBO, TBO, TBO, getBuffer, getBytePerElement, getTupleSize, getTupleInt, getTupleFloat, setBuffer, setIntBuffer, setFloatBuffer, setBuffer, setTupleInt, setTupleFloat, isDirty, getGpuID, isOnSystemMemory, isOnGpuMemory, loadOnSystemMemory, loadOnGpuMemory, updateData, unloadFromSystemMemory, unloadFromGpuMemory, bind, unbind, createFloat




New TBO with no data set.
public void TBO ()


New TBO from given integer buffer.
param  buffer data buffer
param  tupleSize number of value for each tuple
public void TBO (Buffer buffer, int tupleSize)


New TBO from given int array.
param  array data array
param  tupleSize number of value for each tuple
public void TBO (int[] array, int tupleSize)


New TBO from given float array.
param  array data array
param  tupleSize number of value for each tuple
public void TBO (float[] array, int tupleSize)


Get TBO data buffer.
Can be null.
return  Buffer or null if not loaded on system memory
public Buffer getBuffer ()


Get the number of bytes use for each value in the buffer.
This size is derivate from the gpu data type;
return  number of byte per value. 0 is data buffer has not been set
public int getBytePerElement ()


Get number of value for each tuple.
Tuple can represent various objects like :
public int getTupleSize ()


Get a single tuple at index.
param  index tuple index
param  buffer optional buffer
return  tuple
public int[] getTupleInt (int index, int[] buffer)


Get a single tuple at index.
param  index tuple index
param  buffer optional buffer
return  tuple
public float[] getTupleFloat (int index, float[] buffer)

public void setBuffer (Buffer buffer, int tupleSize)


Set VBO datas.
OpenGL constraints : GL2ES2
param  buffer data buffer
param  tupleSize number of value for each tuple
public void setIntBuffer (Buffer buffer, int tupleSize)


Set VBO datas.
param  buffer data buffer
param  tupleSize number of value for each tuple
public void setFloatBuffer (Buffer buffer, int tupleSize)


Set VBO datas.
param  buffer data buffer
param  gpuType gpu data type
param  tupleSize number of value for each tuple
public void setBuffer (Buffer buffer, int gpuType, int tupleSize)


Set a single tuple at index.
param  index tuple index
param  buffer tuple data
public void setTupleInt (int index, int[] buffer)


Set a single tuple at index.
param  index tuple index
param  buffer tuple data
public void setTupleFloat (int index, float[] buffer)


Indicate if the system data buffer values has been changed.
return  true if datas has been changed compared to the last time
they were loaded on the gpu.
public boolean isDirty ()


{@inheritDoc }
public int getGpuID ()


{@inheritDoc }
public boolean isOnSystemMemory ()


{@inheritDoc }
public boolean isOnGpuMemory ()


OpenGL constraints : GL2

{@inheritDoc }
public void loadOnSystemMemory (GL gl)


OpenGL constraints : GL2GL3

{@inheritDoc }
public void loadOnGpuMemory (GL gl)

public void updateData (GL gl)


{@inheritDoc }
public void unloadFromSystemMemory (GL gl)


{@inheritDoc }
public void unloadFromGpuMemory (GL gl)


Bind this buffer providing using given parameters
OpenGL constraints : GL2GL3
param  gl OpenGL instance
public void bind (GL gl)


OpenGL constraints : GL2GL3
param  gl OpenGL instance
public void unbind (GL gl)

public TBO createFloat (int size, int tuleSize)