Interface GLArrayDataEditable
-
- All Superinterfaces:
GLArrayData
- All Known Implementing Classes:
GLArrayDataClient
,GLArrayDataServer
public interface GLArrayDataEditable extends GLArrayData
The total number of bytes hold by the referenced buffer is: getComponentSize()* getComponentNumber() * getElementNumber()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
bindBuffer(GL gl, boolean bind)
ifbind
is true and the data usesVBO
, the latter will be bound and data written to the GPU if required.void
clear()
Clears this buffer and resets states accordingly.void
clear(GL gl)
Clears this buffer and resets states accordingly.void
destroy(GL gl)
void
enableBuffer(GL gl, boolean enable)
Enables the buffer ifenable
istrue
, 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
put3b(byte v1, byte v2, byte v3)
void
put3f(float v1, float v2, float v3)
void
put3i(int v1, int v2, int v3)
void
put3s(short v1, short v2, short v3)
void
put4b(byte v1, byte v2, byte v3, byte v4)
void
put4f(float v1, float v2, float v3, float v4)
void
put4i(int v1, int v2, int v3, int v4)
void
put4s(short v1, short v2, short v3, short v4)
void
putb(byte v)
void
putb(byte[] src, int offset, int length)
void
putf(float v)
void
putf(float[] src, int offset, int length)
void
puti(int v)
void
puti(int[] src, int offset, int length)
void
puts(short v)
void
puts(short[] src, int offset, int length)
void
putx(int v)
void
rewind()
Rewinds this buffer.void
seal(boolean seal)
If seal is true, it disables write operations to the buffer.void
seal(GL gl, boolean seal)
Convenience method callingseal(boolean)
andenableBuffer(GL, boolean)
.void
setEnableAlways(boolean always)
Affects the behavior of 'enableBuffer'.void
setVBOWritten(boolean written)
Marks the buffer written to the VBO-
Methods inherited from interface com.jogamp.opengl.GLArrayData
associate, bytePosition, elemPosition, elemStatsToString, fillStatsToString, getBuffer, getByteCapacity, getByteCount, getBytesPerComp, getCompsPerElem, getCompType, getElemCapacity, getElemCount, getIndex, getLocation, getName, getNormalized, getStride, getVBOName, getVBOOffset, getVBOTarget, getVBOUsage, isVBO, isVertexAttribute, remainingBytes, remainingElems, sealed, setLocation, setLocation, setLocation, setName, toString
-
-
-
-
Method Detail
-
enabled
boolean enabled()
-
isVBOWritten
boolean isVBOWritten()
Is the buffer written to the VBO ?
-
setVBOWritten
void setVBOWritten(boolean written)
Marks the buffer written to the VBO
-
destroy
void destroy(GL gl)
- Specified by:
destroy
in interfaceGLArrayData
-
clear
void clear(GL gl)
Clears this buffer and resets states accordingly.Implementation calls
seal(gl, false)
andclear()
, i.e. turns-off the GL buffer and then clearing it.The position is set to zero, the limit is set to the capacity, and the mark is discarded.
Invoke this method before using a sequence of get or put operations to fill this buffer.
This method does not actually erase the data in the buffer and will most often be used when erasing the underlying memory is suitable.
- See Also:
seal(GL, boolean)
,clear()
-
seal
void seal(GL gl, boolean seal)
Convenience method callingseal(boolean)
andenableBuffer(GL, boolean)
.- See Also:
seal(boolean)
,enableBuffer(GL, boolean)
-
enableBuffer
void enableBuffer(GL gl, boolean enable)
Enables the buffer ifenable
istrue
, and transfers the data if required. In caseVBO is used
, it is bound accordingly for the data transfer and association, i.e. it issuedbindBuffer(GL, boolean)
. The VBO buffer is unbound when the method returns.Disables the buffer if
enable
isfalse
.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.
- See Also:
setEnableAlways(boolean)
-
bindBuffer
boolean bindBuffer(GL gl, boolean bind)
ifbind
is true and the data usesVBO
, the latter will be bound and data written to the GPU if required.If
bind
is false and the data usesVBO
, 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 toenableBuffer(GL, boolean)
, which leaves the VBO unbound, since it's not required for vertex attributes or pointers.- Parameters:
gl
- current GL objectbind
- true if VBO shall be bound and data written, otherwise clear VBO binding.- Returns:
- true if data uses VBO and action was performed, otherwise false
-
setEnableAlways
void setEnableAlways(boolean always)
Affects the behavior of 'enableBuffer'. The default is 'false' This is useful when you mix up GLArrayData usage with conventional GL array calls or in case of a buggy GL VBO implementation.- See Also:
enableBuffer(GL, boolean)
-
clear
void clear()
Clears this buffer and resets states accordingly.The position is set to zero, the limit is set to the capacity, and the mark is discarded.
Invoke this method before using a sequence of get or put operations to fill this buffer.
This method does not actually erase the data in the buffer and will most often be used when erasing the underlying memory is suitable.
- See Also:
clear(GL)
-
seal
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.
- See Also:
seal(boolean)
,GLArrayData.sealed()
-
rewind
void rewind()
Rewinds this buffer. The position is set to zero and the mark is discarded.Invoke this method before a sequence of put or get operations.
-
padding
void padding(int doneInByteSize)
-
put
void put(Buffer v)
-
putb
void putb(byte v)
-
put3b
void put3b(byte v1, byte v2, byte v3)
-
put4b
void put4b(byte v1, byte v2, byte v3, byte v4)
-
putb
void putb(byte[] src, int offset, int length)
-
puts
void puts(short v)
-
put3s
void put3s(short v1, short v2, short v3)
-
put4s
void put4s(short v1, short v2, short v3, short v4)
-
puts
void puts(short[] src, int offset, int length)
-
puti
void puti(int v)
-
put3i
void put3i(int v1, int v2, int v3)
-
put4i
void put4i(int v1, int v2, int v3, int v4)
-
puti
void puti(int[] src, int offset, int length)
-
putx
void putx(int v)
-
putf
void putf(float v)
-
put3f
void put3f(float v1, float v2, float v3)
-
put4f
void put4f(float v1, float v2, float v3, float v4)
-
putf
void putf(float[] src, int offset, int length)
-
-