JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.util.glsl.ShaderState Class Reference

ShaderState allows to sharing data between shader programs, while updating the attribute and uniform locations when switching. More...

Collaboration diagram for com.jogamp.opengl.util.glsl.ShaderState:

Public Member Functions

 ShaderState ()
 
boolean verbose ()
 
void setVerbose (final boolean v)
 
final Object getAttachedObject (final String name)
 Returns the attached user object for the given name to this ShaderState. More...
 
final Object attachObject (final String name, final Object obj)
 Attach user object for the given name to this ShaderState. More...
 
final Object detachObject (final String name)
 
synchronized void useProgram (final GL2ES2 gl, final boolean on) throws GLException
 Turns the shader program on or off. More...
 
boolean linked ()
 
boolean inUse ()
 
synchronized boolean attachShaderProgram (final GL2ES2 gl, final ShaderProgram prog, final boolean enable) throws GLException
 Attach or switch a shader program. More...
 
ShaderProgram shaderProgram ()
 
synchronized void destroy (final GL2ES2 gl)
 Calls release(gl, true, true, true). More...
 
synchronized void releaseAllData (final GL2ES2 gl)
 Calls release(gl, false, false, false). More...
 
synchronized void release (final GL2ES2 gl, final boolean destroyBoundAttributes, final boolean destroyShaderProgram, final boolean destroyShaderCode)
 
int getCachedAttribLocation (final String name)
 Gets the cached location of a shader attribute. More...
 
GLArrayData getAttribute (final String name)
 Get the previous cached vertex attribute data. More...
 
boolean isActiveAttribute (final GLArrayData attribute)
 
void ownAttribute (final GLArrayData attribute, final boolean own)
 Binds or unbinds the GLArrayData lifecycle to this ShaderState. More...
 
boolean ownsAttribute (final GLArrayData attribute)
 
void bindAttribLocation (final GL2ES2 gl, final int location, final String name)
 Binds a shader attribute to a location. More...
 
void bindAttribLocation (final GL2ES2 gl, final int location, final GLArrayData data)
 Binds a shader GLArrayData attribute to a location. More...
 
int getAttribLocation (final GL2ES2 gl, final String name)
 Gets the location of a shader attribute with given name. More...
 
int getAttribLocation (final GL2ES2 gl, final GLArrayData data)
 Validates and returns the location of a shader attribute. More...
 
final boolean isVertexAttribArrayEnabled (final String name)
 
final boolean isVertexAttribArrayEnabled (final GLArrayData data)
 
boolean enableVertexAttribArray (final GL2ES2 gl, final String name)
 Enables a vertex attribute array. More...
 
boolean enableVertexAttribArray (final GL2ES2 gl, final GLArrayData data)
 Enables a vertex attribute array, usually invoked by GLArrayDataEditable#enableBuffer(GL, boolean). More...
 
boolean disableVertexAttribArray (final GL2ES2 gl, final String name)
 Disables a vertex attribute array. More...
 
boolean disableVertexAttribArray (final GL2ES2 gl, final GLArrayData data)
 Disables a vertex attribute array. More...
 
boolean vertexAttribPointer (final GL2ES2 gl, final GLArrayData data)
 Set the GLArrayData vertex attribute data, if it's location is valid, i.e. More...
 
void releaseAllAttributes (final GL2ES2 gl)
 Releases all mapped vertex attribute data, disables all enabled attributes and loses all indices. More...
 
void disableAllVertexAttributeArrays (final GL2ES2 gl, final boolean removeFromState)
 Disables all vertex attribute arrays. More...
 
final int getCachedUniformLocation (final String name)
 Gets the cached location of the shader uniform. More...
 
void ownUniform (final GLUniformData uniform)
 Bind the GLUniform lifecycle to this ShaderState. More...
 
boolean ownsUniform (final GLUniformData uniform)
 
final int getUniformLocation (final GL2ES2 gl, final String name)
 Gets the location of a shader uniform with given name. More...
 
int getUniformLocation (final GL2ES2 gl, final GLUniformData data)
 Validates and returns the location of a shader uniform. More...
 
boolean uniform (final GL2ES2 gl, final GLUniformData data)
 Set the uniform data, if it's location is valid, i.e. More...
 
GLUniformData getUniform (final String name)
 Get the uniform data, previously set. More...
 
void releaseAllUniforms (final GL2ES2 gl)
 Releases all mapped uniform data and loses all indices. More...
 
StringBuilder toString (StringBuilder sb, final boolean alsoUnlocated)
 
String toString ()
 

Static Public Attributes

static final boolean DEBUG
 

Detailed Description

ShaderState allows to sharing data between shader programs, while updating the attribute and uniform locations when switching.

This allows seamless switching of programs using almost same data but performing different artifacts.

A used ShaderState is attached to the current GL context and can be retrieved via getShaderState(GL).

Definition at line 60 of file ShaderState.java.

Constructor & Destructor Documentation

◆ ShaderState()

com.jogamp.opengl.util.glsl.ShaderState.ShaderState ( )

Definition at line 68 of file ShaderState.java.

Member Function Documentation

◆ attachObject()

final Object com.jogamp.opengl.util.glsl.ShaderState.attachObject ( final String  name,
final Object  obj 
)

Attach user object for the given name to this ShaderState.

Returns the previously set object or null.

Returns
the previous mapped object or null if none

Definition at line 88 of file ShaderState.java.

Here is the caller graph for this function:

◆ attachShaderProgram()

synchronized boolean com.jogamp.opengl.util.glsl.ShaderState.attachShaderProgram ( final GL2ES2  gl,
final ShaderProgram  prog,
final boolean  enable 
) throws GLException

Attach or switch a shader program.

Attaching a shader program the first time, as well as switching to another program on the fly, while managing all attribute and uniform data.

[Re]sets all data and use program in case of a program switch.

Use program, useProgram(GL2ES2, boolean), if enable is true.

Returns
true if shader program was attached, otherwise false (already attached)
Exceptions
GLExceptionif program was not linked and linking fails

Definition at line 159 of file ShaderState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bindAttribLocation() [1/2]

void com.jogamp.opengl.util.glsl.ShaderState.bindAttribLocation ( final GL2ES2  gl,
final int  location,
final GLArrayData  data 
)

Binds a shader GLArrayData attribute to a location.

Multiple names can be bound to one location. The value will be cached and can be retrieved via getCachedAttribLocation(String) and getAttribute(String)before or after linking. The GLArrayData's location will be set as well.

Exceptions
GLExceptionif no program is attached
GLExceptionif the program is already linked
See also
com.jogamp.opengl.GL2ES2::glBindAttribLocation(int, int, String)
getAttribLocation(GL2ES2, String)
getCachedAttribLocation(String)
getAttribute(String)

Definition at line 370 of file ShaderState.java.

Here is the call graph for this function:

◆ bindAttribLocation() [2/2]

void com.jogamp.opengl.util.glsl.ShaderState.bindAttribLocation ( final GL2ES2  gl,
final int  location,
final String  name 
)

Binds a shader attribute to a location.

Multiple names can be bound to one location. The value will be cached and can be retrieved via getCachedAttribLocation(String) before or after linking.

Exceptions
GLExceptionif no program is attached
GLExceptionif the program is already linked
See also
com.jogamp.opengl.GL2ES2::glBindAttribLocation(int, int, String)
getAttribLocation(GL2ES2, String)
getCachedAttribLocation(String)

Definition at line 348 of file ShaderState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy()

synchronized void com.jogamp.opengl.util.glsl.ShaderState.destroy ( final GL2ES2  gl)

Calls release(gl, true, true, true).

See also
#glReleaseAllVertexAttributes
#glReleaseAllUniforms
release(GL2ES2, boolean, boolean, boolean)

Definition at line 218 of file ShaderState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detachObject()

final Object com.jogamp.opengl.util.glsl.ShaderState.detachObject ( final String  name)
Parameters
namename of the mapped object to detach
Returns
the previous mapped object or null if none

Definition at line 97 of file ShaderState.java.

◆ disableAllVertexAttributeArrays()

void com.jogamp.opengl.util.glsl.ShaderState.disableAllVertexAttributeArrays ( final GL2ES2  gl,
final boolean  removeFromState 
)

Disables all vertex attribute arrays.

Their enabled stated will be removed from this state only if 'removeFromState' is true.

This method purpose is more for debugging.

See also
#glEnableVertexAttribArray
#glDisableVertexAttribArray
#glVertexAttribPointer
#getVertexAttribPointer
#glReleaseAllVertexAttributes
#glResetAllVertexAttributes
#glResetAllVertexAttributes
ShaderProgram::glReplaceShader

Definition at line 706 of file ShaderState.java.

Here is the call graph for this function:

◆ disableVertexAttribArray() [1/2]

boolean com.jogamp.opengl.util.glsl.ShaderState.disableVertexAttribArray ( final GL2ES2  gl,
final GLArrayData  data 
)

Disables a vertex attribute array.

This method uses the GLArrayData's location if set and is the preferred alternative to disableVertexAttribArray(GL2ES2, String). If data location is unset it will be retrieved via getAttribLocation(GL2ES2, GLArrayData) set and cached in this state.

Even if the attribute is not found in the current shader, it is removed from this state enabled list.

Returns
false, if the name is not found, otherwise true
Exceptions
GLExceptionif no program is attached
GLExceptionif the program is not linked and no location was cached.
See also
#glEnableVertexAttribArray
#glDisableVertexAttribArray
#glVertexAttribPointer
#getVertexAttribPointer

Definition at line 620 of file ShaderState.java.

Here is the call graph for this function:

◆ disableVertexAttribArray() [2/2]

boolean com.jogamp.opengl.util.glsl.ShaderState.disableVertexAttribArray ( final GL2ES2  gl,
final String  name 
)

Disables a vertex attribute array.

This method retrieves the the location via getAttribLocation(GL2ES2, GLArrayData) hence disableVertexAttribArray(GL2ES2, GLArrayData) shall be preferred.

Even if the attribute is not found in the current shader, it is removed from this state enabled list.

Returns
false, if the name is not found, otherwise true
Exceptions
GLExceptionif no program is attached
GLExceptionif the program is not linked and no location was cached.
See also
#glEnableVertexAttribArray
#glDisableVertexAttribArray
#glVertexAttribPointer
#getVertexAttribPointer

Definition at line 595 of file ShaderState.java.

◆ enableVertexAttribArray() [1/2]

boolean com.jogamp.opengl.util.glsl.ShaderState.enableVertexAttribArray ( final GL2ES2  gl,
final GLArrayData  data 
)

Enables a vertex attribute array, usually invoked by GLArrayDataEditable#enableBuffer(GL, boolean).

This method uses the GLArrayData's location if set and is the preferred alternative to enableVertexAttribArray(GL2ES2, String). If data location is unset it will be retrieved via getAttribLocation(GL2ES2, GLArrayData) set and cached in this state.

Even if the attribute is not found in the current shader, it is marked enabled in this state.

Returns
false, if the name is not found, otherwise true
Exceptions
GLExceptionif the program is not linked and no location was cached.
See also
#glEnableVertexAttribArray
#glDisableVertexAttribArray
#glVertexAttribPointer
#getVertexAttribPointer
GLArrayDataEditable::enableBuffer(GL, boolean)

Definition at line 545 of file ShaderState.java.

Here is the call graph for this function:

◆ enableVertexAttribArray() [2/2]

boolean com.jogamp.opengl.util.glsl.ShaderState.enableVertexAttribArray ( final GL2ES2  gl,
final String  name 
)

Enables a vertex attribute array.

This method retrieves the the location via getAttribLocation(GL2ES2, GLArrayData) hence enableVertexAttribArray(GL2ES2, GLArrayData) shall be preferred.

Even if the attribute is not found in the current shader, it is marked enabled in this state.

Returns
false, if the name is not found, otherwise true
Exceptions
GLExceptionif the program is not linked and no location was cached.
See also
#glEnableVertexAttribArray
#glDisableVertexAttribArray
#glVertexAttribPointer
#getVertexAttribPointer

Definition at line 519 of file ShaderState.java.

◆ getAttachedObject()

final Object com.jogamp.opengl.util.glsl.ShaderState.getAttachedObject ( final String  name)

Returns the attached user object for the given name to this ShaderState.

Definition at line 78 of file ShaderState.java.

◆ getAttribLocation() [1/2]

int com.jogamp.opengl.util.glsl.ShaderState.getAttribLocation ( final GL2ES2  gl,
final GLArrayData  data 
)

Validates and returns the location of a shader attribute.


Uses either the cached value getCachedAttribLocation(String) if valid, or the GLSL queried via GL2ES2#glGetAttribLocation(int, String).
The location will be cached and set in the GLArrayData object.

Returns
-1 if there is no such attribute available, otherwise >= 0
Exceptions
GLExceptionif no program is attached
GLExceptionif the program is not linked and no location was cached.
See also
getCachedAttribLocation(String)
bindAttribLocation(GL2ES2, int, GLArrayData)
bindAttribLocation(GL2ES2, int, String)
GL2ES2::glGetAttribLocation(int, String)
getAttribute(String)

Definition at line 436 of file ShaderState.java.

Here is the call graph for this function:

◆ getAttribLocation() [2/2]

int com.jogamp.opengl.util.glsl.ShaderState.getAttribLocation ( final GL2ES2  gl,
final String  name 
)

Gets the location of a shader attribute with given name.


Uses either the cached value getCachedAttribLocation(String) if valid, or the GLSL queried via GL2ES2#glGetAttribLocation(int, String).
The location will be cached.

Returns
-1 if there is no such attribute available, otherwise >= 0
Exceptions
GLExceptionif no program is attached
GLExceptionif the program is not linked and no location was cached.
See also
getCachedAttribLocation(String)
bindAttribLocation(GL2ES2, int, GLArrayData)
bindAttribLocation(GL2ES2, int, String)
GL2ES2::glGetAttribLocation(int, String)

Definition at line 396 of file ShaderState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAttribute()

GLArrayData com.jogamp.opengl.util.glsl.ShaderState.getAttribute ( final String  name)

Get the previous cached vertex attribute data.

Returns
the GLArrayData object, null if not previously set.
See also
ownAttribute(GLArrayData, boolean)
#glEnableVertexAttribArray
#glDisableVertexAttribArray
#glVertexAttribPointer
#getVertexAttribPointer
#glReleaseAllVertexAttributes
#glResetAllVertexAttributes
ShaderProgram::glReplaceShader

Definition at line 290 of file ShaderState.java.

Here is the caller graph for this function:

◆ getCachedAttribLocation()

int com.jogamp.opengl.util.glsl.ShaderState.getCachedAttribLocation ( final String  name)

Gets the cached location of a shader attribute.

Returns
-1 if there is no such attribute available, otherwise >= 0
See also
bindAttribLocation(GL2ES2, int, String)
bindAttribLocation(GL2ES2, int, GLArrayData)
getAttribLocation(GL2ES2, String)
GL2ES2::glGetAttribLocation(int, String)

Definition at line 270 of file ShaderState.java.

Here is the caller graph for this function:

◆ getCachedUniformLocation()

final int com.jogamp.opengl.util.glsl.ShaderState.getCachedUniformLocation ( final String  name)

Gets the cached location of the shader uniform.

Returns
-1 if there is no such uniform available, otherwise >= 0

Definition at line 818 of file ShaderState.java.

Here is the caller graph for this function:

◆ getUniform()

GLUniformData com.jogamp.opengl.util.glsl.ShaderState.getUniform ( final String  name)

Get the uniform data, previously set.

Returns
the GLUniformData object, null if not previously set.

Definition at line 967 of file ShaderState.java.

Here is the caller graph for this function:

◆ getUniformLocation() [1/2]

int com.jogamp.opengl.util.glsl.ShaderState.getUniformLocation ( final GL2ES2  gl,
final GLUniformData  data 
)

Validates and returns the location of a shader uniform.


Uses either the cached value getCachedUniformLocation(String) if valid, or the GLSL queried via GL2ES2#glGetUniformLocation(int, String).
The location will be cached and set in the GLUniformData object.

The current shader program (attachShaderProgram(GL2ES2, ShaderProgram)) must be in use (useProgram(GL2ES2, boolean)) !

Returns
-1 if there is no such attribute available, otherwise >= 0
Exceptions
GLExceptionis the program is not linked
See also
#glGetUniformLocation
com.jogamp.opengl.GL2ES2::glGetUniformLocation
getUniformLocation
ShaderProgram::glReplaceShader

Definition at line 907 of file ShaderState.java.

Here is the call graph for this function:

◆ getUniformLocation() [2/2]

final int com.jogamp.opengl.util.glsl.ShaderState.getUniformLocation ( final GL2ES2  gl,
final String  name 
)

Gets the location of a shader uniform with given name.


Uses either the cached value getCachedUniformLocation(String) if valid, or the GLSL queried via GL2ES2#glGetUniformLocation(int, String).
The location will be cached.

The current shader program (attachShaderProgram(GL2ES2, ShaderProgram)) must be in use (useProgram(GL2ES2, boolean)) !

Returns
-1 if there is no such attribute available, otherwise >= 0
Exceptions
GLExceptionis the program is not linked
See also
#glGetUniformLocation
com.jogamp.opengl.GL2ES2::glGetUniformLocation
getUniformLocation
ShaderProgram::glReplaceShader

Definition at line 869 of file ShaderState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inUse()

boolean com.jogamp.opengl.util.glsl.ShaderState.inUse ( )

Definition at line 139 of file ShaderState.java.

Here is the call graph for this function:

◆ isActiveAttribute()

boolean com.jogamp.opengl.util.glsl.ShaderState.isActiveAttribute ( final GLArrayData  attribute)

Definition at line 294 of file ShaderState.java.

Here is the call graph for this function:

◆ isVertexAttribArrayEnabled() [1/2]

final boolean com.jogamp.opengl.util.glsl.ShaderState.isVertexAttribArrayEnabled ( final GLArrayData  data)
Returns
true if the GLArrayData attribute is enable

Definition at line 476 of file ShaderState.java.

Here is the call graph for this function:

◆ isVertexAttribArrayEnabled() [2/2]

final boolean com.jogamp.opengl.util.glsl.ShaderState.isVertexAttribArrayEnabled ( final String  name)
Returns
true if the named attribute is enable

Definition at line 468 of file ShaderState.java.

Here is the caller graph for this function:

◆ linked()

boolean com.jogamp.opengl.util.glsl.ShaderState.linked ( )

Definition at line 135 of file ShaderState.java.

Here is the call graph for this function:

◆ ownAttribute()

void com.jogamp.opengl.util.glsl.ShaderState.ownAttribute ( final GLArrayData  attribute,
final boolean  own 
)

Binds or unbinds the GLArrayData lifecycle to this ShaderState.

If an attribute location is cached (ie bindAttribLocation(GL2ES2, int, String)) it is promoted to the GLArrayData instance.

The attribute will be destroyed with destroy(GL2ES2) and it's location will be reset when switching shader with attachShaderProgram(GL2ES2, ShaderProgram).

The data will not be transfered to the GPU, use vertexAttribPointer(GL2ES2, GLArrayData) additionally.

The data will also be associated with this ShaderState.

Parameters
attributethe GLArrayData which lifecycle shall be managed
owntrue if owning shall be performs, false if disowning.
See also
bindAttribLocation(GL2ES2, int, String)
getAttribute(String)
GLArrayData::associate(Object, boolean)

Definition at line 318 of file ShaderState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ownsAttribute()

boolean com.jogamp.opengl.util.glsl.ShaderState.ownsAttribute ( final GLArrayData  attribute)

Definition at line 331 of file ShaderState.java.

◆ ownsUniform()

boolean com.jogamp.opengl.util.glsl.ShaderState.ownsUniform ( final GLUniformData  uniform)

Definition at line 846 of file ShaderState.java.

Here is the call graph for this function:

◆ ownUniform()

void com.jogamp.opengl.util.glsl.ShaderState.ownUniform ( final GLUniformData  uniform)

Bind the GLUniform lifecycle to this ShaderState.

If a uniform location is cached it is promoted to the GLUniformData instance.

The attribute will be destroyed with destroy(GL2ES2) and it's location will be reset when switching shader with attachShaderProgram(GL2ES2, ShaderProgram).

The data will not be transfered to the GPU, use uniform(GL2ES2, GLUniformData) additionally.

Parameters
uniformthe GLUniformData which lifecycle shall be managed
See also
getUniform(String)

Definition at line 837 of file ShaderState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ release()

synchronized void com.jogamp.opengl.util.glsl.ShaderState.release ( final GL2ES2  gl,
final boolean  destroyBoundAttributes,
final boolean  destroyShaderProgram,
final boolean  destroyShaderCode 
)
See also
#glReleaseAllVertexAttributes
#glReleaseAllUniforms
ShaderProgram::release(GL2ES2, boolean)

Definition at line 239 of file ShaderState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ releaseAllAttributes()

void com.jogamp.opengl.util.glsl.ShaderState.releaseAllAttributes ( final GL2ES2  gl)

Releases all mapped vertex attribute data, disables all enabled attributes and loses all indices.

See also
#glEnableVertexAttribArray
#glDisableVertexAttribArray
#glVertexAttribPointer
#getVertexAttribPointer
#glReleaseAllVertexAttributes
#glResetAllVertexAttributes
#glResetAllVertexAttributes
ShaderProgram::glReplaceShader

Definition at line 674 of file ShaderState.java.

Here is the caller graph for this function:

◆ releaseAllData()

synchronized void com.jogamp.opengl.util.glsl.ShaderState.releaseAllData ( final GL2ES2  gl)

Calls release(gl, false, false, false).

See also
#glReleaseAllVertexAttributes
#glReleaseAllUniforms
release(GL2ES2, boolean, boolean, boolean)

Definition at line 230 of file ShaderState.java.

Here is the call graph for this function:

◆ releaseAllUniforms()

void com.jogamp.opengl.util.glsl.ShaderState.releaseAllUniforms ( final GL2ES2  gl)

Releases all mapped uniform data and loses all indices.

Definition at line 975 of file ShaderState.java.

Here is the caller graph for this function:

◆ setVerbose()

void com.jogamp.opengl.util.glsl.ShaderState.setVerbose ( final boolean  v)

Definition at line 73 of file ShaderState.java.

Here is the caller graph for this function:

◆ shaderProgram()

ShaderProgram com.jogamp.opengl.util.glsl.ShaderState.shaderProgram ( )

Definition at line 209 of file ShaderState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString() [1/2]

String com.jogamp.opengl.util.glsl.ShaderState.toString ( )

Definition at line 1070 of file ShaderState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString() [2/2]

StringBuilder com.jogamp.opengl.util.glsl.ShaderState.toString ( StringBuilder  sb,
final boolean  alsoUnlocated 
)

Definition at line 1016 of file ShaderState.java.

Here is the call graph for this function:

◆ uniform()

boolean com.jogamp.opengl.util.glsl.ShaderState.uniform ( final GL2ES2  gl,
final GLUniformData  data 
)

Set the uniform data, if it's location is valid, i.e.

≥ 0.

This method uses the GLUniformData's location if valid, i.e. ≥ 0.
If data's location is invalid, it will be retrieved via getUniformLocation(GL2ES2, GLUniformData), set and cached in this state.

Returns
false, if the location could not be determined, otherwise true
See also
#glGetUniformLocation
com.jogamp.opengl.GL2ES2::glGetUniformLocation
com.jogamp.opengl.GL2ES2::glUniform
getUniformLocation
ShaderProgram::glReplaceShader

Definition at line 945 of file ShaderState.java.

Here is the call graph for this function:

◆ useProgram()

synchronized void com.jogamp.opengl.util.glsl.ShaderState.useProgram ( final GL2ES2  gl,
final boolean  on 
) throws GLException

Turns the shader program on or off.


Exceptions
GLExceptionif no program is attached
See also
com.jogamp.opengl.util.glsl.ShaderState::useProgram(GL2ES2, boolean)

Definition at line 108 of file ShaderState.java.

Here is the call graph for this function:

◆ verbose()

boolean com.jogamp.opengl.util.glsl.ShaderState.verbose ( )

Definition at line 71 of file ShaderState.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vertexAttribPointer()

boolean com.jogamp.opengl.util.glsl.ShaderState.vertexAttribPointer ( final GL2ES2  gl,
final GLArrayData  data 
)

Set the GLArrayData vertex attribute data, if it's location is valid, i.e.

≥ 0.

This method uses the GLArrayData's location if valid, i.e. ≥ 0.
If data's location is invalid, it will be retrieved via getAttribLocation(GL2ES2, GLArrayData), set and cached in this state.

Returns
false, if the location could not be determined, otherwise true
Exceptions
GLExceptionif no program is attached
GLExceptionif the program is not linked and no location was cached.
See also
#glEnableVertexAttribArray
#glDisableVertexAttribArray
#glVertexAttribPointer
#getVertexAttribPointer

Definition at line 645 of file ShaderState.java.

Here is the call graph for this function:

Member Data Documentation

◆ DEBUG

final boolean com.jogamp.opengl.util.glsl.ShaderState.DEBUG
static

Definition at line 61 of file ShaderState.java.


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