Top Description Methods
com.jogamp.opengl

public Interface GLArrayData

Known Direct Subinterfaces
com.jogamp.opengl.util.GLArrayDataEditable
Known Direct Implementers
com.jogamp.opengl.util.GLArrayDataWrapper
Imports
java.nio.Buffer, com.jogamp.opengl.fixedfunc.GLPointerFunc

The total number of bytes hold by the referenced buffer is: getComponentSize()* getComponentNumber() * getElementNumber()

Method Summary

Modifier and TypeMethod and Description
public void
associate(Object
implementation and type dependent association
obj
,
boolean
pass true to enable the association and false to disable it.
enable
)

Implementation and type dependent object association.

public void
destroy(GL gl)

public Buffer
getBuffer()

The Buffer holding the data, may be null if a GPU buffer without client bound data

public int
getComponentCount()

The number of components per element

public int
getComponentSizeInBytes()

The component's size in bytes

public int
getComponentType()

The component's GL data type, ie.

public int
getElementCount()

The current number of used elements.

public int
getIndex()

The index of the predefined array index, see list below, or -1 in case of a shader attribute array.

public int
getLocation()

Returns the shader attribute location for this name, -1 if not yet determined

public String
getName()

The name of the reflecting shader array attribute.

public boolean
getNormalized()

True, if GL shall normalize fixed point data while converting them into float.

public int
getSizeInBytes()

The currently used size in bytes.

public int

Returns:

the byte offset between consecutive components
getStride
()

public int
getVBOName()

The VBO name or 0 if not a VBO

public long
getVBOOffset()

The VBO buffer offset or 0 if not a VBO

public int

Returns:

0 if not a GPU buffer, otherwise GL#GL_ARRAY_BUFFER or GL#GL_ELEMENT_ARRAY_BUFFER
getVBOTarget
()

The VBO target or 0 if not a VBO

public int

Returns:

0 if not a GPU buffer, otherwise GL2ES2#GL_STREAM_DRAW, GL#GL_STATIC_DRAW or GL#GL_DYNAMIC_DRAW
getVBOUsage
()

The VBO usage or 0 if not a VBO

public boolean
isVBO()

Determines whether the data is server side (VBO) and enabled, or a client side array (false).

public 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

public int

Returns:

the given location
setLocation
(int v)

Sets the given location of the shader attribute

public int

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
(GL2ES2 gl, int program)

Retrieves the location of the shader attribute from the linked shader program.

public int

Returns:

the given location
setLocation
(GL2ES2 gl, int program, int location)

Binds the location of the shader attribute to the given location for the unlinked shader program.

public void
setName(String newName)

Set a new name for this array.

public String

Method Detail

associateback to summary
public void associate(Object obj, boolean enable)

Implementation and type dependent object association.

One currently known use case is to associate a ShaderState to 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 via shaderState.ownAttribute(GLArrayData, boolean).

Parameters
obj:Object

implementation and type dependent association

enable:boolean

pass true to enable the association and false to disable it.

destroyback to summary
public void destroy(GL gl)
getBufferback to summary
public Buffer getBuffer()

The Buffer holding the data, may be null if a GPU buffer without client bound data

getComponentCountback to summary
public int getComponentCount()

The number of components per element

getComponentSizeInBytesback to summary
public int getComponentSizeInBytes()

The component's size in bytes

getComponentTypeback to summary
public int getComponentType()

The component's GL data type, ie. GL_FLOAT

getElementCountback to summary
public int getElementCount()

The current number of used elements.

On element consist out of getComponentCount() components.

In case the buffer's position is 0 (sealed, flipped), it's based on it's limit instead of it's position.
getIndexback to summary
public int getIndex()

The index of the predefined array index, see list below, or -1 in case of a shader attribute array.

See Also
GLPointerFunc#GL_VERTEX_ARRAY, GLPointerFunc#GL_NORMAL_ARRAY, GLPointerFunc#GL_COLOR_ARRAY, GLPointerFunc#GL_TEXTURE_COORD_ARRAY
getLocationback to summary
public int getLocation()

Returns the shader attribute location for this name, -1 if not yet determined

getNameback to summary
public String getName()

The name of the reflecting shader array attribute.

getNormalizedback to summary
public boolean getNormalized()

True, if GL shall normalize fixed point data while converting them into float.

Default behavior (of the fixed function pipeline) is true for fixed point data type and false for floating point data types.

getSizeInBytesback to summary
public int getSizeInBytes()

The currently used size in bytes.
In case the buffer's position is 0 (sealed, flipped), it's based on it's limit instead of it's position.

getStrideback to summary
public int getStride()
Returns:int

the byte offset between consecutive components

getVBONameback to summary
public int getVBOName()

The VBO name or 0 if not a VBO

getVBOOffsetback to summary
public long getVBOOffset()

The VBO buffer offset or 0 if not a VBO

getVBOTargetback to summary
public int getVBOTarget()

The VBO target or 0 if not a VBO

Returns:int

0 if not a GPU buffer, otherwise GL#GL_ARRAY_BUFFER or GL#GL_ELEMENT_ARRAY_BUFFER

getVBOUsageback to summary
public int getVBOUsage()

The VBO usage or 0 if not a VBO

Returns:int

0 if not a GPU buffer, otherwise GL2ES2#GL_STREAM_DRAW, GL#GL_STATIC_DRAW or GL#GL_DYNAMIC_DRAW

isVBOback to summary
public boolean isVBO()

Determines whether the data is server side (VBO) and enabled, or a client side array (false).

isVertexAttributeback to summary
public 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

setLocationback to summary
public int setLocation(int v)

Sets the given location of the shader attribute

Returns:int

the given location

See Also
com.jogamp.opengl.util.glsl.ShaderState#vertexAttribPointer(GL2ES2, GLArrayData)
setLocationback to summary
public 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.

Returns:int

≥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.

setLocationback to summary
public 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.

Returns:int

the given location

setNameback to summary
public 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)
toStringback to summary
public String toString()
Annotations
@Override