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

GLSL uniform data wrapper encapsulating data to be uploaded to the GPU as a uniform. More...

Collaboration diagram for com.jogamp.opengl.GLUniformData:

Public Member Functions

 GLUniformData (final String name, final int val)
 int atom More...
 
 GLUniformData (final String name, final float val)
 float atom More...
 
 GLUniformData (final String name, final int components, final IntBuffer data)
 Multiple IntBuffer Vector. More...
 
 GLUniformData (final String name, final int components, final FloatBuffer data)
 Multiple FloatBuffer Vector. More...
 
 GLUniformData (final String name, final int components, final SyncBuffer syncBuffer)
 Multiple IntBuffer or FloatBuffer Vector. More...
 
 GLUniformData (final String name, final int rows, final int columns, final FloatBuffer data)
 Multiple FloatBuffer Matrix. More...
 
 GLUniformData (final String name, final int rows, final int columns, final SyncBuffer syncBuffer)
 Multiple FloatBuffer Matrix. More...
 
GLUniformData setData (final int data)
 
GLUniformData setData (final float data)
 
GLUniformData setData (final IntBuffer data)
 
GLUniformData setData (final FloatBuffer data)
 
GLUniformData setData (final SyncBuffer syncedBuffer)
 
int intValue ()
 
float floatValue ()
 
IntBuffer intBufferValue ()
 
FloatBuffer floatBufferValue ()
 
StringBuilder toString (StringBuilder sb)
 
String toString ()
 
String getName ()
 Return the uniform name as used in the shader. More...
 
int getLocation ()
 
int setLocation (final int location)
 Sets the given location of the shader uniform. More...
 
int setLocation (final GL2ES2 gl, final int program)
 Retrieves the location of the shader uniform with getName() from the linked shader program. More...
 
Object getObject ()
 Returns the data object. More...
 
Buffer getBuffer ()
 Returns the data buffer. More...
 
boolean isMatrix ()
 
boolean isBuffer ()
 
int count ()
 
int components ()
 
int rows ()
 
int columns ()
 

Static Public Member Functions

static GLUniformData creatEmptyVector (final String name, final int components)
 
static GLUniformData creatEmptyMatrix (final String name, final int rows, final int columns)
 

Detailed Description

GLSL uniform data wrapper encapsulating data to be uploaded to the GPU as a uniform.

Definition at line 42 of file GLUniformData.java.

Constructor & Destructor Documentation

◆ GLUniformData() [1/7]

com.jogamp.opengl.GLUniformData.GLUniformData ( final String  name,
final int  val 
)

int atom

Number of objects is 1

Parameters
namethe uniform name as used in the shader

Definition at line 51 of file GLUniformData.java.

Here is the caller graph for this function:

◆ GLUniformData() [2/7]

com.jogamp.opengl.GLUniformData.GLUniformData ( final String  name,
final float  val 
)

float atom

Number of objects is 1

Parameters
namethe uniform name as used in the shader

Definition at line 62 of file GLUniformData.java.

◆ GLUniformData() [3/7]

com.jogamp.opengl.GLUniformData.GLUniformData ( final String  name,
final int  components,
final IntBuffer  data 
)

Multiple IntBuffer Vector.

Number of objects is calculated by data.limit()/components

Parameters
namethe uniform name as used in the shader
componentsnumber of elements of one object, ie 4 for GL_FLOAT_VEC4,
datathe data

Definition at line 75 of file GLUniformData.java.

Here is the call graph for this function:

◆ GLUniformData() [4/7]

com.jogamp.opengl.GLUniformData.GLUniformData ( final String  name,
final int  components,
final FloatBuffer  data 
)

Multiple FloatBuffer Vector.

Number of objects is calculated by data.limit()/components

Parameters
namethe uniform name as used in the shader
componentsnumber of elements of one object, ie 4 for GL_FLOAT_VEC4,
datathe underlying data

Definition at line 88 of file GLUniformData.java.

Here is the call graph for this function:

◆ GLUniformData() [5/7]

com.jogamp.opengl.GLUniformData.GLUniformData ( final String  name,
final int  components,
final SyncBuffer  syncBuffer 
)

Multiple IntBuffer or FloatBuffer Vector.

Number of objects is calculated by data.limit()/components

Parameters
namethe uniform name as used in the shader
componentsnumber of elements of one object, ie 4 for GL_FLOAT_VEC4,
syncBufferSyncBuffer providing SyncAction and Buffer, allowing to sync the buffer with the underlying data, see getBuffer()

Definition at line 101 of file GLUniformData.java.

Here is the call graph for this function:

◆ GLUniformData() [6/7]

com.jogamp.opengl.GLUniformData.GLUniformData ( final String  name,
final int  rows,
final int  columns,
final FloatBuffer  data 
)

Multiple FloatBuffer Matrix.

Number of objects is calculated by data.limit()/(rows*columns)

Parameters
namethe uniform name as used in the shader
rowsthe matrix rows
columnthe matrix column
datathe underlying data

Definition at line 127 of file GLUniformData.java.

◆ GLUniformData() [7/7]

com.jogamp.opengl.GLUniformData.GLUniformData ( final String  name,
final int  rows,
final int  columns,
final SyncBuffer  syncBuffer 
)

Multiple FloatBuffer Matrix.

Number of objects is calculated by data.limit()/(rows*columns)

Parameters
namethe uniform name as used in the shader
rowsthe matrix rows
columnthe matrix column
syncBufferSyncBuffer providing SyncAction and Buffer, allowing to sync the buffer with the underlying data, see getBuffer()

Definition at line 141 of file GLUniformData.java.

Here is the call graph for this function:

Member Function Documentation

◆ columns()

int com.jogamp.opengl.GLUniformData.columns ( )

Definition at line 317 of file GLUniformData.java.

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

◆ components()

int com.jogamp.opengl.GLUniformData.components ( )

Definition at line 315 of file GLUniformData.java.

Here is the caller graph for this function:

◆ count()

int com.jogamp.opengl.GLUniformData.count ( )

Definition at line 314 of file GLUniformData.java.

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

◆ creatEmptyMatrix()

static GLUniformData com.jogamp.opengl.GLUniformData.creatEmptyMatrix ( final String  name,
final int  rows,
final int  columns 
)
static

Definition at line 113 of file GLUniformData.java.

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

◆ creatEmptyVector()

static GLUniformData com.jogamp.opengl.GLUniformData.creatEmptyVector ( final String  name,
final int  components 
)
static

Definition at line 109 of file GLUniformData.java.

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

◆ floatBufferValue()

FloatBuffer com.jogamp.opengl.GLUniformData.floatBufferValue ( )

Definition at line 155 of file GLUniformData.java.

◆ floatValue()

float com.jogamp.opengl.GLUniformData.floatValue ( )

Definition at line 153 of file GLUniformData.java.

◆ getBuffer()

Buffer com.jogamp.opengl.GLUniformData.getBuffer ( )

Returns the data buffer.

In case a SyncAction has been set, it is invoked to synchronize the buffer with the underlying data before returning the buffer.

Returns
the data buffer.
See also
SyncAction::sync()

Definition at line 304 of file GLUniformData.java.

Here is the caller graph for this function:

◆ getLocation()

int com.jogamp.opengl.GLUniformData.getLocation ( )

Definition at line 256 of file GLUniformData.java.

Here is the caller graph for this function:

◆ getName()

String com.jogamp.opengl.GLUniformData.getName ( )

Return the uniform name as used in the shader.

Definition at line 254 of file GLUniformData.java.

Here is the caller graph for this function:

◆ getObject()

Object com.jogamp.opengl.GLUniformData.getObject ( )

Returns the data object.

In case a SyncAction has been set, it is invoked to synchronize the object with the underlying data before returning the object.

Returns
the data object.
See also
SyncAction::sync()

Definition at line 288 of file GLUniformData.java.

◆ intBufferValue()

IntBuffer com.jogamp.opengl.GLUniformData.intBufferValue ( )

Definition at line 154 of file GLUniformData.java.

◆ intValue()

int com.jogamp.opengl.GLUniformData.intValue ( )

Definition at line 152 of file GLUniformData.java.

Here is the caller graph for this function:

◆ isBuffer()

boolean com.jogamp.opengl.GLUniformData.isBuffer ( )

Definition at line 312 of file GLUniformData.java.

Here is the caller graph for this function:

◆ isMatrix()

boolean com.jogamp.opengl.GLUniformData.isMatrix ( )

Definition at line 311 of file GLUniformData.java.

Here is the caller graph for this function:

◆ rows()

int com.jogamp.opengl.GLUniformData.rows ( )

Definition at line 316 of file GLUniformData.java.

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

◆ setData() [1/5]

GLUniformData com.jogamp.opengl.GLUniformData.setData ( final float  data)

Definition at line 146 of file GLUniformData.java.

◆ setData() [2/5]

GLUniformData com.jogamp.opengl.GLUniformData.setData ( final FloatBuffer  data)

Definition at line 149 of file GLUniformData.java.

◆ setData() [3/5]

GLUniformData com.jogamp.opengl.GLUniformData.setData ( final int  data)

Definition at line 145 of file GLUniformData.java.

Here is the caller graph for this function:

◆ setData() [4/5]

GLUniformData com.jogamp.opengl.GLUniformData.setData ( final IntBuffer  data)

Definition at line 148 of file GLUniformData.java.

◆ setData() [5/5]

GLUniformData com.jogamp.opengl.GLUniformData.setData ( final SyncBuffer  syncedBuffer)

Definition at line 150 of file GLUniformData.java.

Here is the call graph for this function:

◆ setLocation() [1/2]

int com.jogamp.opengl.GLUniformData.setLocation ( final GL2ES2  gl,
final int  program 
)

Retrieves the location of the shader uniform with getName() from the linked shader program.

No validation is performed within the implementation.

Parameters
gl
program
Returns
≥0 denotes a valid uniform location as found and used in the given shader program. <0 denotes an invalid location, i.e. not found or used in the given shader program.

Definition at line 274 of file GLUniformData.java.

Here is the call graph for this function:

◆ setLocation() [2/2]

int com.jogamp.opengl.GLUniformData.setLocation ( final int  location)

Sets the given location of the shader uniform.

Returns
the given location

Definition at line 262 of file GLUniformData.java.

Here is the caller graph for this function:

◆ toString() [1/2]

String com.jogamp.opengl.GLUniformData.toString ( )

Definition at line 184 of file GLUniformData.java.

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

◆ toString() [2/2]

StringBuilder com.jogamp.opengl.GLUniformData.toString ( StringBuilder  sb)

Definition at line 158 of file GLUniformData.java.

Here is the call graph for this function:

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