com.jogamp.opengl.util
Class GLArrayDataWrapper

java.lang.Object
  extended by com.jogamp.opengl.util.GLArrayDataWrapper
All Implemented Interfaces:
GLArrayData
Direct Known Subclasses:
GLArrayDataClient

public class GLArrayDataWrapper
extends Object
implements GLArrayData


Method Summary
static GLArrayDataWrapper createFixed(GL gl, int index, int comps, int dataType, boolean normalized, int stride, Buffer buffer, int vboName, long bufferOffset)
           
static GLArrayDataWrapper createGLSL(GL gl, String name, int comps, int dataType, boolean normalized, int stride, Buffer buffer, int vboName, long bufferOffset)
           
 void destroy(GL gl)
           
 Buffer getBuffer()
          The Buffer holding the data, may be null in case of VBO
 Class getBufferClass()
           
static Class getBufferClass(int dataType)
           
 int getComponentNumber()
          The number of components per element
 int getComponentSize()
          The components size in bytes
 int getComponentType()
          The component's GL data type, ie.
 int getElementNumber()
          Return the number of elements.
 int getIndex()
          The index of the predefined array index, see list below, or -1 in case of a shader attribute array.
 int getLocation()
          Returns the shader attribute location for this name, -1 if not yet determined
 String getName()
          The name of the reflecting shader array attribute.
 boolean getNormalized()
          True, if GL shall normalize fixed point data while converting them into float
 long getOffset()
          The offset, if it's an VBO, otherwise -1
 int getStride()
          The distance to the next payload, allowing interleaved arrays.
 int getVBOName()
          The VBO name, if it's an VBO, otherwise -1
 boolean isVBO()
          Determines wheather the data is server side (VBO), or a client side array (false).
 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
 void setLocation(int v)
          Sets the determined location of the shader attribute This is usually done within ShaderState.
 void setName(String newName)
          Set a new name for this array.
 void setVBOName(int vboName)
           
 void setVBOUsage(boolean vboUsage)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createFixed

public static GLArrayDataWrapper createFixed(GL gl,
                                             int index,
                                             int comps,
                                             int dataType,
                                             boolean normalized,
                                             int stride,
                                             Buffer buffer,
                                             int vboName,
                                             long bufferOffset)
                                      throws GLException
Throws:
GLException

createGLSL

public static GLArrayDataWrapper createGLSL(GL gl,
                                            String name,
                                            int comps,
                                            int dataType,
                                            boolean normalized,
                                            int stride,
                                            Buffer buffer,
                                            int vboName,
                                            long bufferOffset)
                                     throws GLException
Throws:
GLException

isVertexAttribute

public final boolean isVertexAttribute()
Description copied from interface: GLArrayData
Returns true if this data set is intended for a GLSL vertex shader attribute, otherwise false, ie intended for fixed function vertex pointer

Specified by:
isVertexAttribute in interface GLArrayData

getIndex

public final int getIndex()
Description copied from interface: GLArrayData
The index of the predefined array index, see list below, or -1 in case of a shader attribute array.

Specified by:
getIndex in interface GLArrayData
See Also:
GLPointerFunc.GL_VERTEX_ARRAY, GLPointerFunc.GL_NORMAL_ARRAY, GLPointerFunc.GL_COLOR_ARRAY, GLPointerFunc.GL_TEXTURE_COORD_ARRAY

getLocation

public final int getLocation()
Description copied from interface: GLArrayData
Returns the shader attribute location for this name, -1 if not yet determined

Specified by:
getLocation in interface GLArrayData

setLocation

public final void setLocation(int v)
Description copied from interface: GLArrayData
Sets the determined location of the shader attribute This is usually done within ShaderState.

Specified by:
setLocation in interface GLArrayData
See Also:
ShaderState.glVertexAttribPointer(GL2ES2, GLArrayData)

getName

public final String getName()
Description copied from interface: GLArrayData
The name of the reflecting shader array attribute.

Specified by:
getName in interface GLArrayData

getOffset

public final long getOffset()
Description copied from interface: GLArrayData
The offset, if it's an VBO, otherwise -1

Specified by:
getOffset in interface GLArrayData

getVBOName

public final int getVBOName()
Description copied from interface: GLArrayData
The VBO name, if it's an VBO, otherwise -1

Specified by:
getVBOName in interface GLArrayData

isVBO

public final boolean isVBO()
Description copied from interface: GLArrayData
Determines wheather the data is server side (VBO), or a client side array (false).

Specified by:
isVBO in interface GLArrayData

getBuffer

public final Buffer getBuffer()
Description copied from interface: GLArrayData
The Buffer holding the data, may be null in case of VBO

Specified by:
getBuffer in interface GLArrayData

getComponentNumber

public final int getComponentNumber()
Description copied from interface: GLArrayData
The number of components per element

Specified by:
getComponentNumber in interface GLArrayData

getComponentType

public final int getComponentType()
Description copied from interface: GLArrayData
The component's GL data type, ie. GL_FLOAT

Specified by:
getComponentType in interface GLArrayData

getComponentSize

public final int getComponentSize()
Description copied from interface: GLArrayData
The components size in bytes

Specified by:
getComponentSize in interface GLArrayData

getElementNumber

public final int getElementNumber()
Description copied from interface: GLArrayData
Return the number of elements.

Specified by:
getElementNumber in interface GLArrayData

getNormalized

public final boolean getNormalized()
Description copied from interface: GLArrayData
True, if GL shall normalize fixed point data while converting them into float

Specified by:
getNormalized in interface GLArrayData

getStride

public final int getStride()
Description copied from interface: GLArrayData
The distance to the next payload, allowing interleaved arrays.

Specified by:
getStride in interface GLArrayData

getBufferClass

public final Class getBufferClass()

destroy

public void destroy(GL gl)
Specified by:
destroy in interface GLArrayData

toString

public String toString()
Specified by:
toString in interface GLArrayData
Overrides:
toString in class Object

getBufferClass

public static final Class getBufferClass(int dataType)

setName

public void setName(String newName)
Description copied from interface: GLArrayData
Set a new name for this array.

Specified by:
setName in interface GLArrayData

setVBOUsage

public void setVBOUsage(boolean vboUsage)

setVBOName

public void setVBOName(int vboName)


Copyright 2010 JogAmp Community.