JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.util.GLArrayDataEditable Interface Reference

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

Inheritance diagram for com.jogamp.opengl.util.GLArrayDataEditable:
Collaboration diagram for com.jogamp.opengl.util.GLArrayDataEditable:

Public Member Functions

boolean enabled ()
 
boolean isVBOWritten ()
 Is the buffer written to the VBO ? More...
 
void setVBOWritten (boolean written)
 Marks the buffer written to the VBO. More...
 
void destroy (GL gl)
 
void clear (GL gl)
 Clears this buffer and resets states accordingly. More...
 
void seal (GL gl, boolean seal)
 Convenience method calling seal(boolean) and enableBuffer(GL, boolean). More...
 
void enableBuffer (GL gl, boolean enable)
 Enables the buffer if enable is true, and transfers the data if required. More...
 
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. More...
 
void setEnableAlways (boolean always)
 Affects the behavior of 'enableBuffer'. More...
 
void clear ()
 Clears this buffer and resets states accordingly. More...
 
void seal (boolean seal)
 
void rewind ()
 Rewinds this buffer. More...
 
void padding (int doneInByteSize)
 
void put (Buffer v)
 
void putb (byte v)
 
void put3b (byte v1, byte v2, byte v3)
 
void put4b (byte v1, byte v2, byte v3, byte v4)
 
void putb (byte[] src, int offset, int length)
 
void puts (short v)
 
void put3s (short v1, short v2, short v3)
 
void put4s (short v1, short v2, short v3, short v4)
 
void puts (short[] src, int offset, int length)
 
void puti (int v)
 
void put3i (int v1, int v2, int v3)
 
void put4i (int v1, int v2, int v3, int v4)
 
void puti (int[] src, int offset, int length)
 
void putx (int v)
 
void putf (float v)
 
void put3f (float v1, float v2, float v3)
 
void put4f (float v1, float v2, float v3, float v4)
 
void putf (float[] src, int offset, int length)
 
- Public Member Functions inherited from com.jogamp.opengl.GLArrayData
void associate (Object obj, boolean enable)
 Implementation and type dependent object association. More...
 
boolean isVertexAttribute ()
 Returns true if this data set is intended for a GLSL vertex shader attribute, otherwise false, ie intended for fixed function vertex pointer. More...
 
int getIndex ()
 The index of the predefined array index, see list below, or -1 in case of a shader attribute array. More...
 
String getName ()
 The name of the reflecting shader array attribute. More...
 
void setName (String newName)
 Set a new name for this array. More...
 
int getLocation ()
 Returns the shader attribute location for this name, -1 if not yet determined. More...
 
int setLocation (int v)
 Sets the given location of the shader attribute. More...
 
int setLocation (GL2ES2 gl, int program)
 Retrieves the location of the shader attribute from the linked shader program. More...
 
int setLocation (GL2ES2 gl, int program, int location)
 Binds the location of the shader attribute to the given location for the unlinked shader program. More...
 
boolean isVBO ()
 Determines whether the data is server side (VBO) and enabled, or a client side array (false). More...
 
long getVBOOffset ()
 The VBO buffer offset or 0 if not a VBO. More...
 
int getVBOName ()
 The VBO name or 0 if not a VBO. More...
 
int getVBOUsage ()
 The VBO usage or 0 if not a VBO. More...
 
int getVBOTarget ()
 The VBO target or 0 if not a VBO. More...
 
Buffer getBuffer ()
 The Buffer holding the data, may be null if a GPU buffer without client bound data. More...
 
int getCompsPerElem ()
 The number of components per element. More...
 
int getCompType ()
 The component's GL data type, ie. More...
 
int getBytesPerComp ()
 The component's size in bytes. More...
 
boolean sealed ()
 Returns true if data has been sealed (flipped to read), otherwise false (writing mode). More...
 
int getElemCount ()
 Returns the element position (written elements) if not sealed() or the element limit (available to read) after sealed() (flip). More...
 
int elemPosition ()
 Returns the element position. More...
 
int remainingElems ()
 The current number of remaining elements. More...
 
int getElemCapacity ()
 Return the element capacity. More...
 
int getByteCount ()
 Returns the byte position (written elements) if not sealed() or the byte limit (available to read) after sealed() (flip). More...
 
int bytePosition ()
 Returns the bytes position. More...
 
int remainingBytes ()
 The current number of remaining bytes. More...
 
int getByteCapacity ()
 Return the capacity in bytes. More...
 
String fillStatsToString ()
 Returns a string with detailed buffer fill stats. More...
 
String elemStatsToString ()
 Returns a string with detailed buffer element stats, i.e. More...
 
boolean getNormalized ()
 True, if GL shall normalize fixed point data while converting them into float. More...
 
int getStride ()
 
String toString ()
 
void destroy (GL gl)
 

Detailed Description

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

Definition at line 41 of file GLArrayDataEditable.java.

Member Function Documentation

◆ bindBuffer()

boolean com.jogamp.opengl.util.GLArrayDataEditable.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
glcurrent GL object
bindtrue if VBO shall be bound and data written, otherwise clear VBO binding.
Returns
true if data uses VBO and action was performed, otherwise false

Implemented in com.jogamp.opengl.util.GLArrayDataClient.

◆ clear() [1/2]

void com.jogamp.opengl.util.GLArrayDataEditable.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)

Implemented in com.jogamp.opengl.util.GLArrayDataClient.

◆ clear() [2/2]

void com.jogamp.opengl.util.GLArrayDataEditable.clear ( GL  gl)

Clears this buffer and resets states accordingly.

Implementation calls seal(gl, false) and clear(), 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()

Implemented in com.jogamp.opengl.util.GLArrayDataClient.

◆ destroy()

void com.jogamp.opengl.util.GLArrayDataEditable.destroy ( GL  gl)

◆ enableBuffer()

void com.jogamp.opengl.util.GLArrayDataEditable.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)

Implemented in com.jogamp.opengl.util.GLArrayDataClient.

◆ enabled()

boolean com.jogamp.opengl.util.GLArrayDataEditable.enabled ( )

◆ isVBOWritten()

boolean com.jogamp.opengl.util.GLArrayDataEditable.isVBOWritten ( )

Is the buffer written to the VBO ?

Implemented in com.jogamp.opengl.util.GLArrayDataClient.

◆ padding()

void com.jogamp.opengl.util.GLArrayDataEditable.padding ( int  doneInByteSize)

◆ put()

void com.jogamp.opengl.util.GLArrayDataEditable.put ( Buffer  v)

◆ put3b()

void com.jogamp.opengl.util.GLArrayDataEditable.put3b ( byte  v1,
byte  v2,
byte  v3 
)

◆ put3f()

void com.jogamp.opengl.util.GLArrayDataEditable.put3f ( float  v1,
float  v2,
float  v3 
)

◆ put3i()

void com.jogamp.opengl.util.GLArrayDataEditable.put3i ( int  v1,
int  v2,
int  v3 
)

◆ put3s()

void com.jogamp.opengl.util.GLArrayDataEditable.put3s ( short  v1,
short  v2,
short  v3 
)

◆ put4b()

void com.jogamp.opengl.util.GLArrayDataEditable.put4b ( byte  v1,
byte  v2,
byte  v3,
byte  v4 
)

◆ put4f()

void com.jogamp.opengl.util.GLArrayDataEditable.put4f ( float  v1,
float  v2,
float  v3,
float  v4 
)

◆ put4i()

void com.jogamp.opengl.util.GLArrayDataEditable.put4i ( int  v1,
int  v2,
int  v3,
int  v4 
)

◆ put4s()

void com.jogamp.opengl.util.GLArrayDataEditable.put4s ( short  v1,
short  v2,
short  v3,
short  v4 
)

◆ putb() [1/2]

void com.jogamp.opengl.util.GLArrayDataEditable.putb ( byte  v)

◆ putb() [2/2]

void com.jogamp.opengl.util.GLArrayDataEditable.putb ( byte[]  src,
int  offset,
int  length 
)

◆ putf() [1/2]

void com.jogamp.opengl.util.GLArrayDataEditable.putf ( float  v)

◆ putf() [2/2]

void com.jogamp.opengl.util.GLArrayDataEditable.putf ( float[]  src,
int  offset,
int  length 
)

◆ puti() [1/2]

void com.jogamp.opengl.util.GLArrayDataEditable.puti ( int  v)

◆ puti() [2/2]

void com.jogamp.opengl.util.GLArrayDataEditable.puti ( int[]  src,
int  offset,
int  length 
)

◆ puts() [1/2]

void com.jogamp.opengl.util.GLArrayDataEditable.puts ( short  v)

◆ puts() [2/2]

void com.jogamp.opengl.util.GLArrayDataEditable.puts ( short[]  src,
int  offset,
int  length 
)

◆ putx()

void com.jogamp.opengl.util.GLArrayDataEditable.putx ( int  v)

◆ rewind()

void com.jogamp.opengl.util.GLArrayDataEditable.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.

Implemented in com.jogamp.opengl.util.GLArrayDataClient.

◆ seal() [1/2]

void com.jogamp.opengl.util.GLArrayDataEditable.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)
sealed()

Implemented in com.jogamp.opengl.util.GLArrayDataClient.

◆ seal() [2/2]

void com.jogamp.opengl.util.GLArrayDataEditable.seal ( GL  gl,
boolean  seal 
)

◆ setEnableAlways()

void com.jogamp.opengl.util.GLArrayDataEditable.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)

Implemented in com.jogamp.opengl.util.GLArrayDataClient.

◆ setVBOWritten()

void com.jogamp.opengl.util.GLArrayDataEditable.setVBOWritten ( boolean  written)

Marks the buffer written to the VBO.

Implemented in com.jogamp.opengl.util.GLArrayDataClient.


The documentation for this interface was generated from the following file: