public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayDataEditable
DEBUG
Modifier and Type | Method and Description |
---|---|
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/disables the buffer,
sets the client state, binds the VBO if used
and transfers the data if necessary.
|
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() |
createFixed, createGLSL, getBuffer, getBufferClass, getBufferClass, getComponentCount, getComponentSizeInBytes, getComponentType, getElementCount, getIndex, getLocation, getName, getNormalized, getSizeInBytes, getStride, getVBOName, getVBOOffset, getVBOTarget, getVBOUsage, isVBO, isVertexAttribute, setLocation, setName, setVBOEnabled, setVBOName, setVBOTarget, setVBOUsage, validate
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBuffer, getComponentCount, getComponentSizeInBytes, getComponentType, getElementCount, getIndex, getLocation, getName, getNormalized, getSizeInBytes, getStride, getVBOName, getVBOOffset, getVBOTarget, getVBOUsage, isVBO, isVertexAttribute, setLocation, setName
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
- GLException
javax.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 dataGLException
javax.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 dataGLException
public final boolean isVBOWritten()
GLArrayDataEditable
isVBOWritten
in interface GLArrayDataEditable
public final boolean sealed()
sealed
in interface GLArrayDataEditable
public final boolean enabled()
enabled
in interface GLArrayDataEditable
public final void setVBOWritten(boolean written)
GLArrayDataEditable
setVBOWritten
in interface GLArrayDataEditable
public void destroy(GL gl)
destroy
in interface GLArrayDataEditable
destroy
in interface GLArrayData
destroy
in class GLArrayDataWrapper
public void reset(GL gl)
reset
in interface GLArrayDataEditable
public void seal(GL gl, boolean seal)
GLArrayDataEditable
GLArrayDataEditable.seal(boolean)
and GLArrayDataEditable.enableBuffer(GL, boolean)
.seal
in interface GLArrayDataEditable
GLArrayDataEditable.seal(boolean)
,
GLArrayDataEditable.enableBuffer(GL, boolean)
public void enableBuffer(GL gl, boolean enable)
GLArrayDataEditable
Enables/disables the buffer, sets the client state, binds the VBO if used and transfers the data if necessary.
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 GLArrayDataEditable
GLArrayDataEditable.setEnableAlways(boolean)
public void setEnableAlways(boolean always)
GLArrayDataEditable
setEnableAlways
in interface GLArrayDataEditable
GLArrayDataEditable.enableBuffer(GL, boolean)
public void reset()
reset
in interface GLArrayDataEditable
public void seal(boolean seal)
GLArrayDataEditable
If 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 GLArrayDataEditable
GLArrayDataEditable.seal(boolean)
public void rewind()
rewind
in interface GLArrayDataEditable
public void padding(int doneInByteSize)
padding
in interface GLArrayDataEditable
public void put(Buffer v)
put
in interface GLArrayDataEditable
public void putb(byte v)
putb
in interface GLArrayDataEditable
public void puts(short v)
puts
in interface GLArrayDataEditable
public void puti(int v)
puti
in interface GLArrayDataEditable
public void putx(int v)
putx
in interface GLArrayDataEditable
public void putf(float v)
putf
in interface GLArrayDataEditable
public String toString()
toString
in interface GLArrayData
toString
in class GLArrayDataWrapper
Copyright 2010 JogAmp Community.