public interface GLArrayDataEditable extends GLArrayData
Modifier and Type | Method and Description |
---|---|
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. |
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) |
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
seal(boolean) and 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
|
associate, getBuffer, getComponentCount, getComponentSizeInBytes, getComponentType, getElementCount, getIndex, getLocation, getName, getNormalized, getSizeInBytes, getStride, getVBOName, getVBOOffset, getVBOTarget, getVBOUsage, isVBO, isVertexAttribute, setLocation, setLocation, setLocation, setName, toString
boolean sealed()
boolean enabled()
boolean isVBOWritten()
void setVBOWritten(boolean written)
void destroy(GL gl)
destroy
in interface GLArrayData
void reset(GL gl)
void seal(GL gl, boolean seal)
seal(boolean)
and enableBuffer(GL, boolean)
.seal(boolean)
,
enableBuffer(GL, boolean)
void enableBuffer(GL gl, boolean enable)
enable
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 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.
setEnableAlways(boolean)
boolean bindBuffer(GL gl, boolean bind)
bind
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 enableBuffer(GL, boolean)
,
which leaves the VBO unbound, since it's not required for vertex attributes or pointers.
gl
- current GL objectbind
- true if VBO shall be bound and data written,
otherwise clear VBO binding.void setEnableAlways(boolean always)
enableBuffer(GL, boolean)
void reset()
void seal(boolean seal)
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(boolean)
void rewind()
void padding(int doneInByteSize)
void put(Buffer v)
void putb(byte v)
void puts(short v)
void puti(int v)
void putx(int v)
void putf(float v)
Copyright 2010 JogAmp Community.