Interface GLArrayData
-
- All Known Subinterfaces:
GLArrayDataEditable
- All Known Implementing Classes:
GLArrayDataClient,GLArrayDataServer,GLArrayDataWrapper
public interface GLArrayDataThe total number of bytes hold by the referenced buffer is: getComponentSize()* getComponentNumber() * getElementNumber()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidassociate(Object obj, boolean enable)Implementation and type dependent object association.intbytePosition()Returns the bytes position.voiddestroy(GL gl)intelemPosition()Returns the element position.StringelemStatsToString()Returns a string with detailed buffer element stats, i.e.StringfillStatsToString()Returns a string with detailed buffer fill stats.BuffergetBuffer()The Buffer holding the data, may be null if a GPU buffer without client bound dataintgetByteCapacity()Return the capacity in bytes.intgetByteCount()intgetBytesPerComp()The component's size in bytesintgetCompsPerElem()The number of components per elementintgetCompType()The component's GL data type, ie.intgetElemCapacity()Return the element capacity.intgetElemCount()intgetIndex()The index of the predefined array index, see list below, or -1 in case of a shader attribute array.intgetLocation()Returns the shader attribute location for this name, -1 if not yet determinedStringgetName()The name of the reflecting shader array attribute.booleangetNormalized()True, if GL shall normalize fixed point data while converting them into float.intgetStride()intgetVBOName()The VBO name or 0 if not a VBOlonggetVBOOffset()The VBO buffer offset or 0 if not a VBOintgetVBOTarget()The VBO target or 0 if not a VBOintgetVBOUsage()The VBO usage or 0 if not a VBObooleanisVBO()Determines whether the data is server side (VBO) and enabled, or a client side array (false).booleanisVertexAttribute()Returns true if this data set is intended for a GLSL vertex shader attribute, otherwise false, ie intended for fixed function vertex pointerintremainingBytes()The current number of remaining bytes.intremainingElems()The current number of remaining elements.booleansealed()Returns true if data has beensealed(flipped to read), otherwise false (writing mode).intsetLocation(int v)Sets the given location of the shader attributeintsetLocation(GL2ES2 gl, int program)Retrieves the location of the shader attribute from the linked shader program.intsetLocation(GL2ES2 gl, int program, int location)Binds the location of the shader attribute to the given location for the unlinked shader program.voidsetName(String newName)Set a new name for this array.StringtoString()
-
-
-
Method Detail
-
associate
void associate(Object obj, boolean enable)
Implementation and type dependent object association.One currently known use case is to associate a
ShaderStateto an GLSL aware vertex attribute object, allowing to use the ShaderState to handle it's data persistence, location and state change.
This is implicitly done viashaderState.ownAttribute(GLArrayData, boolean).- Parameters:
obj- implementation and type dependent associationenable- pass true to enable the association and false to disable it.
-
isVertexAttribute
boolean isVertexAttribute()
Returns true if this data set is intended for a GLSL vertex shader attribute, otherwise false, ie intended for fixed function vertex pointer
-
getIndex
int getIndex()
The index of the predefined array index, see list below, or -1 in case of a shader attribute array.
-
getName
String getName()
The name of the reflecting shader array attribute.
-
setName
void setName(String newName)
Set a new name for this array.This clears the location, i.e. sets it to -1.
- See Also:
setLocation(int),setLocation(GL2ES2, int)
-
getLocation
int getLocation()
Returns the shader attribute location for this name, -1 if not yet determined
-
setLocation
int setLocation(int v)
Sets the given location of the shader attribute- Returns:
- the given location
- See Also:
ShaderState.vertexAttribPointer(GL2ES2, GLArrayData)
-
setLocation
int setLocation(GL2ES2 gl, int program)
Retrieves the location of the shader attribute from the linked shader program.No validation is performed within the implementation.
- Parameters:
gl-program-- Returns:
- ≥0 denotes a valid attribute location as found and used in the given shader program. <0 denotes an invalid location, i.e. not found or used in the given shader program.
-
setLocation
int setLocation(GL2ES2 gl, int program, int location)
Binds the location of the shader attribute to the given location for the unlinked shader program.No validation is performed within the implementation.
- Parameters:
gl-program-- Returns:
- the given location
-
isVBO
boolean isVBO()
Determines whether the data is server side (VBO) and enabled, or a client side array (false).
-
getVBOOffset
long getVBOOffset()
The VBO buffer offset or 0 if not a VBO
-
getVBOName
int getVBOName()
The VBO name or 0 if not a VBO
-
getVBOUsage
int getVBOUsage()
The VBO usage or 0 if not a VBO- Returns:
- 0 if not a GPU buffer, otherwise
GL2ES2.GL_STREAM_DRAW,GL.GL_STATIC_DRAWorGL.GL_DYNAMIC_DRAW
-
getVBOTarget
int getVBOTarget()
The VBO target or 0 if not a VBO- Returns:
- 0 if not a GPU buffer, otherwise
GL.GL_ARRAY_BUFFERorGL.GL_ELEMENT_ARRAY_BUFFER
-
getBuffer
Buffer getBuffer()
The Buffer holding the data, may be null if a GPU buffer without client bound data
-
getCompsPerElem
int getCompsPerElem()
The number of components per element
-
getCompType
int getCompType()
The component's GL data type, ie. GL_FLOAT
-
getBytesPerComp
int getBytesPerComp()
The component's size in bytes
-
sealed
boolean sealed()
Returns true if data has beensealed(flipped to read), otherwise false (writing mode).
-
getElemCount
int getElemCount()
Returns the element position (written elements) if notsealed()or the element limit (available to read) aftersealed()(flip).On element consist out of
getCompsPerElem()components.- See Also:
sealed(),getByteCount(),elemPosition(),remainingElems(),getElemCapacity()
-
elemPosition
int elemPosition()
Returns the element position.On element consist out of
getCompsPerElem()components.- See Also:
bytePosition(),getElemCount(),remainingElems(),getElemCapacity()
-
remainingElems
int remainingElems()
The current number of remaining elements.On element consist out of
Returns the number of elements between the current position and the limit, i.e. remaining elements to write in this buffer.getCompsPerElem()components.- See Also:
remainingBytes(),getElemCount(),elemPosition(),getElemCapacity()
-
getElemCapacity
int getElemCapacity()
Return the element capacity.On element consist out of
getCompsPerElem()components.- See Also:
getByteCapacity(),getElemCount(),elemPosition(),remainingElems()
-
getByteCount
int getByteCount()
Returns the byte position (written elements) if notsealed()or the byte limit (available to read) aftersealed()(flip).- See Also:
sealed(),getElemCount(),bytePosition(),remainingBytes(),getByteCapacity()
-
bytePosition
int bytePosition()
Returns the bytes position.- See Also:
elemPosition(),getByteCount(),remainingElems(),getElemCapacity()
-
remainingBytes
int remainingBytes()
The current number of remaining bytes.Returns the number of bytes between the current position and the limit, i.e. remaining bytes to write in this buffer.
- See Also:
remainingElems(),getByteCount(),bytePosition(),getByteCapacity()
-
getByteCapacity
int getByteCapacity()
Return the capacity in bytes.- See Also:
getElemCapacity(),getByteCount(),bytePosition(),remainingBytes()
-
fillStatsToString
String fillStatsToString()
Returns a string with detailed buffer fill stats.
-
elemStatsToString
String elemStatsToString()
Returns a string with detailed buffer element stats, i.e. sealed, count, position, remaining, limit and capacity.
-
getNormalized
boolean getNormalized()
True, if GL shall normalize fixed point data while converting them into float.Default behavior (of the fixed function pipeline) is
truefor fixed point data type andfalsefor floating point data types.
-
getStride
int getStride()
- Returns:
- the byte offset between consecutive components
-
destroy
void destroy(GL gl)
-
-