Top Description Methods
com.jogamp.opengl.util

public Interface GLArrayDataEditable

extends GLArrayData
Known Direct Implementers
com.jogamp.opengl.util.GLArrayDataServer, com.jogamp.opengl.util.GLArrayDataClient
Imports
com.jogamp.opengl.*, java.nio.*

The total number of bytes hold by the referenced buffer is: getComponentSize()* getComponentNumber() * getElementNumber()

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if data uses VBO and action was performed, otherwise false
bindBuffer
(GL
current GL object
gl
,
boolean
true if VBO shall be bound and data written, otherwise clear VBO binding.
bind
)

if bind is true and the data uses VBO, the latter will be bound and data written to the GPU if required.

public void
public void
enableBuffer(GL gl, boolean enable)

Enables the buffer if enable is true, and transfers the data if required.

public boolean
public boolean
isVBOWritten()

Is the buffer written to the VBO ?

public void
padding(int doneInByteSize)

public void
public void
putb(byte v)

public void
putf(float v)

public void
puti(int v)

public void
puts(short v)

public void
putx(int v)

public void
reset(GL gl)

public void
public void
public void
seal(GL gl, boolean seal)

Convenience method calling seal(boolean) and enableBuffer(GL, boolean).

public void
seal(boolean seal)

If seal is true, it disables write operations to the buffer.

public boolean
public void
setEnableAlways(boolean always)

Affects the behavior of 'enableBuffer'.

public void
setVBOWritten(boolean written)

Marks the buffer written to the VBO

Inherited from com.jogamp.opengl.GLArrayData:
associategetBuffergetComponentCountgetComponentSizeInBytesgetComponentTypegetElementCountgetIndexgetLocationgetNamegetNormalizedgetSizeInBytesgetStridegetVBONamegetVBOOffsetgetVBOTargetgetVBOUsageisVBOisVertexAttributesetLocationsetLocationsetLocationsetNametoString

Method Detail

bindBufferback to summary
public 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.

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.

Parameters
gl:GL

current GL object

bind:boolean

true if VBO shall be bound and data written, otherwise clear VBO binding.

Returns:boolean

true if data uses VBO and action was performed, otherwise false

destroyback to summary
public void destroy(GL gl)

Redeclares com.jogamp.opengl.GLArrayData.destroy.

Annotations
@Override
enableBufferback to summary
public void enableBuffer(GL gl, boolean enable)

Enables the buffer if 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.

See Also
setEnableAlways(boolean)
enabledback to summary
public boolean enabled()
isVBOWrittenback to summary
public boolean isVBOWritten()

Is the buffer written to the VBO ?

paddingback to summary
public void padding(int doneInByteSize)
putback to summary
public void put(Buffer v)
putbback to summary
public void putb(byte v)
putfback to summary
public void putf(float v)
putiback to summary
public void puti(int v)
putsback to summary
public void puts(short v)
putxback to summary
public void putx(int v)
resetback to summary
public void reset(GL gl)
resetback to summary
public void reset()
rewindback to summary
public void rewind()
sealback to summary
public void seal(GL gl, boolean seal)

Convenience method calling seal(boolean) and enableBuffer(GL, boolean).

See Also
seal(boolean), enableBuffer(GL, boolean)
sealback to summary
public 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)
sealedback to summary
public boolean sealed()
setEnableAlwaysback to summary
public 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)
setVBOWrittenback to summary
public void setVBOWritten(boolean written)

Marks the buffer written to the VBO