|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jogamp.opengl.util.GLArrayDataWrapper
public class GLArrayDataWrapper
| Field Summary | |
|---|---|
static boolean |
DEBUG
|
| Method Summary | |
|---|---|
static GLArrayDataWrapper |
createFixed(int index,
int comps,
int dataType,
boolean normalized,
int stride,
Buffer buffer,
int vboName,
long vboOffset,
int vboUsage,
int vboTarget)
Create a VBO, using a predefined fixed function array index, wrapping the given data. |
static GLArrayDataWrapper |
createGLSL(String name,
int comps,
int dataType,
boolean normalized,
int stride,
Buffer buffer,
int vboName,
long vboOffset,
int vboUsage,
int vboTarget)
Create a VBO, using a custom GLSL array attribute name, wrapping the given data. |
void |
destroy(GL gl)
|
Buffer |
getBuffer()
The Buffer holding the data, may be null if a GPU buffer without client bound data |
Class |
getBufferClass()
|
static Class |
getBufferClass(int dataType)
|
int |
getComponentCount()
The number of components per element |
int |
getComponentSizeInBytes()
The component's size in bytes |
int |
getComponentType()
The component's GL data type, ie. |
int |
getElementCount()
The current number of used 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 |
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. |
int |
getStride()
|
int |
getVBOName()
The VBO name or 0 if not a VBO |
long |
getVBOOffset()
The VBO buffer offset or 0 if not a VBO |
int |
getVBOTarget()
The VBO target or 0 if not a VBO |
int |
getVBOUsage()
The VBO usage or 0 if not a VBO |
boolean |
isVBO()
Determines whether the data is server side (VBO) and enabled, 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 |
setVBOEnabled(boolean vboEnabled)
Enable or disable use of VBO. |
void |
setVBOName(int vboName)
Set the VBO buffer name, if valid (!= 0) enable use of VBO, otherwise (==0) disable VBO usage. |
void |
setVBOTarget(int vboTarget)
|
void |
setVBOUsage(int vboUsage)
|
String |
toString()
|
boolean |
validate(GLProfile glp,
boolean throwException)
Validates this instance's parameter. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEBUG
| Method Detail |
|---|
public static GLArrayDataWrapper createFixed(int index,
int comps,
int dataType,
boolean normalized,
int stride,
Buffer buffer,
int vboName,
long vboOffset,
int vboUsage,
int vboTarget)
throws GLException
index - The GL array indexcomps - The array component numberdataType - The array index GL data typenormalized - Whether the data shall be normalizedstride - buffer - the user define datavboName - vboOffset - vboUsage - GL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAWvboTarget - GL.GL_ARRAY_BUFFER or GL.GL_ELEMENT_ARRAY_BUFFER
GLException
public static GLArrayDataWrapper createGLSL(String name,
int comps,
int dataType,
boolean normalized,
int stride,
Buffer buffer,
int vboName,
long vboOffset,
int vboUsage,
int vboTarget)
throws GLException
name - The custom name for the GL attribute, maybe null if gpuBufferTarget is GL.GL_ELEMENT_ARRAY_BUFFERcomps - The array component numberdataType - The array index GL data typenormalized - Whether the data shall be normalizedstride - buffer - the user define datavboName - vboOffset - vboUsage - GL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAWvboTarget - GL.GL_ARRAY_BUFFER or GL.GL_ELEMENT_ARRAY_BUFFER
GLException
public final boolean validate(GLProfile glp,
boolean throwException)
GLArrayDataClient and GLArrayDataServer.
GLArrayDataWrapper does not validate it's instance by itself.
glp - the GLProfile to usethrowException - whether to throw an exception if this instance has invalid parameter or not
public final boolean isVertexAttribute()
GLArrayData
isVertexAttribute in interface GLArrayDatapublic final int getIndex()
GLArrayData
getIndex in interface GLArrayDataGLPointerFunc.GL_VERTEX_ARRAY,
GLPointerFunc.GL_NORMAL_ARRAY,
GLPointerFunc.GL_COLOR_ARRAY,
GLPointerFunc.GL_TEXTURE_COORD_ARRAYpublic final int getLocation()
GLArrayData
getLocation in interface GLArrayDatapublic final void setLocation(int v)
GLArrayData
setLocation in interface GLArrayDataShaderState.vertexAttribPointer(GL2ES2, GLArrayData)public final String getName()
GLArrayData
getName in interface GLArrayDatapublic final long getVBOOffset()
GLArrayData
getVBOOffset in interface GLArrayDatapublic final int getVBOName()
GLArrayData
getVBOName in interface GLArrayDatapublic final boolean isVBO()
GLArrayData
isVBO in interface GLArrayDatapublic final int getVBOUsage()
GLArrayData
getVBOUsage in interface GLArrayDataGL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAWpublic final int getVBOTarget()
GLArrayData
getVBOTarget in interface GLArrayDataGL.GL_ARRAY_BUFFER or GL.GL_ELEMENT_ARRAY_BUFFERpublic final Buffer getBuffer()
GLArrayData
getBuffer in interface GLArrayDatapublic final int getComponentCount()
GLArrayData
getComponentCount in interface GLArrayDatapublic final int getComponentType()
GLArrayData
getComponentType in interface GLArrayDatapublic final int getComponentSizeInBytes()
GLArrayData
getComponentSizeInBytes in interface GLArrayDatapublic final int getElementCount()
GLArrayData
On element consist out of GLArrayData.getComponentCount() components.
getElementCount in interface GLArrayDatapublic final int getSizeInBytes()
GLArrayData
getSizeInBytes in interface GLArrayDatapublic final boolean getNormalized()
GLArrayData
getNormalized in interface GLArrayDatapublic final int getStride()
getStride in interface GLArrayDatapublic final Class getBufferClass()
public void destroy(GL gl)
destroy in interface GLArrayDatapublic String toString()
toString in interface GLArrayDatatoString in class Objectpublic static final Class getBufferClass(int dataType)
public void setName(String newName)
GLArrayData
setName in interface GLArrayDatapublic void setVBOEnabled(boolean vboEnabled)
setVBOName(int)public void setVBOName(int vboName)
setVBOEnabled(boolean)public void setVBOUsage(int vboUsage)
vboUsage - GL2ES2.GL_STREAM_DRAW, GL.GL_STATIC_DRAW or GL.GL_DYNAMIC_DRAWpublic void setVBOTarget(int vboTarget)
vboTarget - either GL.GL_ARRAY_BUFFER or GL.GL_ELEMENT_ARRAY_BUFFER
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||