|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jogamp.opengl.util.GLArrayDataWrapper
com.jogamp.opengl.util.GLArrayDataClient
public class GLArrayDataClient
| Field Summary |
|---|
| Fields inherited from class com.jogamp.opengl.util.GLArrayDataWrapper |
|---|
DEBUG |
| Method Summary | |
|---|---|
void |
associate(Object obj,
boolean enable)
Implementation and type dependent object association. |
boolean |
bindBuffer(GL gl,
boolean bind)
if bind is true and the data uses VBO,
the latter will be bound and data written to the GPU if required. |
static GLArrayDataClient |
createFixed(int index,
int comps,
int dataType,
boolean normalized,
int initialElementCount)
Create a client side buffer object, using a predefined fixed function array index and starting with a new created Buffer object with initialElementCount size On profiles GL2 and ES1 the fixed function pipeline behavior is as expected. |
static GLArrayDataClient |
createFixed(int index,
int comps,
int dataType,
boolean normalized,
int stride,
Buffer buffer)
Create a client side buffer object, using a predefined fixed function array index and starting with a given Buffer object incl it's stride On profiles GL2 and ES1 the fixed function pipeline behavior is as expected. |
static GLArrayDataClient |
createGLSL(String name,
int comps,
int dataType,
boolean normalized,
int initialElementCount)
Create a client side buffer object, using a custom GLSL array attribute name and starting with a new created Buffer object with initialElementCount size |
static GLArrayDataClient |
createGLSL(String name,
int comps,
int dataType,
boolean normalized,
int stride,
Buffer buffer)
Create a client side buffer object, using a custom GLSL array attribute name and starting with a given Buffer object incl it's stride |
void |
destroy(GL gl)
|
void |
enableBuffer(GL gl,
boolean enable)
Enables the buffer if enable is true,
and transfers the data if required. |
boolean |
enabled()
|
boolean |
isVBOWritten()
Is the buffer written to the VBO ? |
void |
padding(int doneInByteSize)
|
void |
put(Buffer v)
Generic buffer relative put method. |
void |
putb(byte v)
|
void |
putf(float v)
|
void |
puti(int v)
|
void |
puts(short v)
|
void |
putx(int v)
|
void |
reset()
|
void |
reset(GL gl)
|
void |
rewind()
|
void |
seal(boolean seal)
If seal is true, it disables write operations to the buffer. |
void |
seal(GL gl,
boolean seal)
Convenience method calling GLArrayDataEditable.seal(boolean) and GLArrayDataEditable.enableBuffer(GL, boolean). |
boolean |
sealed()
|
void |
setEnableAlways(boolean always)
Affects the behavior of 'enableBuffer'. |
void |
setVBOWritten(boolean written)
Marks the buffer written to the VBO |
String |
toString()
|
| Methods inherited from class com.jogamp.opengl.util.GLArrayDataWrapper |
|---|
createFixed, createGLSL, getBuffer, getBufferClass, getBufferClass, getComponentCount, getComponentSizeInBytes, getComponentType, getElementCount, getIndex, getLocation, getName, getNormalized, getSizeInBytes, getStride, getVBOName, getVBOOffset, getVBOTarget, getVBOUsage, isVBO, isVertexAttribute, setLocation, setLocation, setLocation, setName, setVBOEnabled, setVBOName, setVBOTarget, setVBOUsage, validate |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.media.opengl.GLArrayData |
|---|
getBuffer, getComponentCount, getComponentSizeInBytes, getComponentType, getElementCount, getIndex, getLocation, getName, getNormalized, getSizeInBytes, getStride, getVBOName, getVBOOffset, getVBOTarget, getVBOUsage, isVBO, isVertexAttribute, setLocation, setLocation, setLocation, setName |
| Method Detail |
|---|
public static GLArrayDataClient createFixed(int index,
int comps,
int dataType,
boolean normalized,
int initialElementCount)
throws GLException
GLPointerFuncUtil.getPredefinedArrayIndexName(int).
index - The GL array indexcomps - The array component numberdataType - The array index GL data typenormalized - Whether the data shall be normalizedinitialElementCount -
GLExceptionjavax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
public static GLArrayDataClient createFixed(int index,
int comps,
int dataType,
boolean normalized,
int stride,
Buffer buffer)
throws GLException
GLPointerFuncUtil.getPredefinedArrayIndexName(int).
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 data
GLExceptionjavax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
public static GLArrayDataClient createGLSL(String name,
int comps,
int dataType,
boolean normalized,
int initialElementCount)
throws GLException
name - The custom name for the GL attribute.comps - The array component numberdataType - The array index GL data typenormalized - Whether the data shall be normalizedinitialElementCount -
GLException
public static GLArrayDataClient createGLSL(String name,
int comps,
int dataType,
boolean normalized,
int stride,
Buffer buffer)
throws GLException
name - The custom name for the GL attribute.comps - The array component numberdataType - The array index GL data typenormalized - Whether the data shall be normalizedstride - buffer - the user define data
GLException
public void associate(Object obj,
boolean enable)
GLArrayData
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).
associate in interface GLArrayDataassociate in class GLArrayDataWrapperobj - implementation and type dependent associationenable - pass true to enable the association and false to disable it.public final boolean isVBOWritten()
GLArrayDataEditable
isVBOWritten in interface GLArrayDataEditablepublic final boolean sealed()
sealed in interface GLArrayDataEditablepublic final boolean enabled()
enabled in interface GLArrayDataEditablepublic final void setVBOWritten(boolean written)
GLArrayDataEditable
setVBOWritten in interface GLArrayDataEditablepublic void destroy(GL gl)
destroy in interface GLArrayDataEditabledestroy in interface GLArrayDatadestroy in class GLArrayDataWrapperpublic void reset(GL gl)
reset in interface GLArrayDataEditable
public void seal(GL gl,
boolean seal)
GLArrayDataEditableGLArrayDataEditable.seal(boolean) and GLArrayDataEditable.enableBuffer(GL, boolean).
seal in interface GLArrayDataEditableGLArrayDataEditable.seal(boolean),
GLArrayDataEditable.enableBuffer(GL, boolean)
public void enableBuffer(GL gl,
boolean enable)
GLArrayDataEditableenable is true,
and transfers the data if required.
In case VBO is used, it is bound accordingly for the data transfer and association,
i.e. it issued GLArrayDataEditable.bindBuffer(GL, boolean).
The VBO buffer is unbound when the method returns.
Disables the buffer if enable is false.
The action will only be executed, if the internal enable state differs, or 'setEnableAlways' was called with 'true'.
It is up to the user to enable/disable the array properly, ie in case of multiple data sets for the same vertex attribute (VA). Meaning in such case usage of one set while expecting another one to be used for the same VA implies decorating each usage with enable/disable.
enableBuffer in interface GLArrayDataEditableGLArrayDataEditable.setEnableAlways(boolean)
public boolean bindBuffer(GL gl,
boolean bind)
GLArrayDataEditablebind is true and the data uses VBO,
the latter will be bound and data written to the GPU if required.
If bind is false and the data uses VBO,
the latter will be unbound.
This method is exposed to allow data VBO arrays, i.e. GL.GL_ELEMENT_ARRAY_BUFFER,
to be bounded and written while keeping the VBO bound. The latter is in contrast to GLArrayDataEditable.enableBuffer(GL, boolean),
which leaves the VBO unbound, since it's not required for vertex attributes or pointers.
bindBuffer in interface GLArrayDataEditablegl - current GL objectbind - true if VBO shall be bound and data written,
otherwise clear VBO binding.
public void setEnableAlways(boolean always)
GLArrayDataEditable
setEnableAlways in interface GLArrayDataEditableGLArrayDataEditable.enableBuffer(GL, boolean)public void reset()
reset in interface GLArrayDataEditablepublic void seal(boolean seal)
GLArrayDataEditableIf seal is true, it disables write operations to the buffer. Calls flip, ie limit:=position and position:=0.
If seal is false, it enable write operations continuing at the buffer position, where you left off at seal(true), ie position:=limit and limit:=capacity.
seal in interface GLArrayDataEditableGLArrayDataEditable.seal(boolean)public void rewind()
rewind in interface GLArrayDataEditablepublic void padding(int doneInByteSize)
padding in interface GLArrayDataEditablepublic void put(Buffer v)
put in interface GLArrayDataEditablepublic void putb(byte v)
putb in interface GLArrayDataEditablepublic void puts(short v)
puts in interface GLArrayDataEditablepublic void puti(int v)
puti in interface GLArrayDataEditablepublic void putx(int v)
putx in interface GLArrayDataEditablepublic void putf(float v)
putf in interface GLArrayDataEditablepublic String toString()
toString in interface GLArrayDatatoString in class GLArrayDataWrapper
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||