PrOGL
processing open-gl interface
Loading...
Searching...
No Matches
Uniform< T > Class Template Reference

organizes information for a single Uniform, including its underlying data type and update behavior. More...

Collaboration diagram for Uniform< T >:

Package Functions

 Uniform (String name, T val, uniform_type type)
 constant Uniform constructor.
 
 Uniform (String name, T val, uniform_type type, Function< T, T > update_function)
 updatable Uniform constructor.
 
void update ()
 update a uniforms value if applicable, ie.
 
void set_uniform (PShader program)
 set this uniform within a given program.
 
void print ()
 print out data structure for debugging.
 

Package Attributes

String name
 name used to reference uniform
 
val
 data value
 
uniform_type type
 data type of the val member
 
Function< T, T > update_function = t -> t
 a pass by value update function
 
boolean update_flag
 wether to update or not
 

Detailed Description

organizes information for a single Uniform, including its underlying data type and update behavior.

Definition at line 27 of file Uniform.pde.

Constructor & Destructor Documentation

◆ Uniform() [1/2]

Uniform< T >.Uniform ( String  name,
val,
uniform_type  type 
)
package

constant Uniform constructor.

this constructor will initialize the uniform and set update_flag to false.

Parameters
namethe Uniform name as referenced in the glsl shader code
valthe value to initialize the Uniform with
typethe data type of val

Definition at line 43 of file Uniform.pde.

References Uniform< T >.name, Uniform< T >.type, and Uniform< T >.val.

◆ Uniform() [2/2]

Uniform< T >.Uniform ( String  name,
val,
uniform_type  type,
Function< T, T >  update_function 
)
package

updatable Uniform constructor.

this constructor will initialize the uniform with an update_function, setting update_flag to true.

Parameters
namethe Uniform name as referenced in the glsl shader code
valthe value to initialize the Uniform with
typethe data type of val
update_functiona lambda function, taking, updating, and returning the data type of this Uniform.

Definition at line 61 of file Uniform.pde.

References Uniform< T >.name, Uniform< T >.type, Uniform< T >.update_function, and Uniform< T >.val.

Member Function Documentation

◆ print()

void Uniform< T >.print ( )
package

print out data structure for debugging.

Definition at line 132 of file Uniform.pde.

References Uniform< T >.name, Uniform< T >.type, Uniform< T >.update_flag, Uniform< T >.update_function, and Uniform< T >.val.

◆ set_uniform()

void Uniform< T >.set_uniform ( PShader  program)
package

set this uniform within a given program.

Definition at line 83 of file Uniform.pde.

References Texture.img, Uniform< T >.name, Uniform< T >.type, and Uniform< T >.val.

◆ update()

void Uniform< T >.update ( )
package

update a uniforms value if applicable, ie.

update_flag = true.

Definition at line 72 of file Uniform.pde.

References Uniform< T >.update_flag, Uniform< T >.update_function, and Uniform< T >.val.

Member Data Documentation

◆ name

String Uniform< T >.name
package

name used to reference uniform

Definition at line 29 of file Uniform.pde.

◆ type

uniform_type Uniform< T >.type
package

data type of the val member

Definition at line 31 of file Uniform.pde.

◆ update_flag

boolean Uniform< T >.update_flag
package

wether to update or not

Definition at line 33 of file Uniform.pde.

◆ update_function

Function<T, T> Uniform< T >.update_function = t -> t
package

a pass by value update function

Definition at line 32 of file Uniform.pde.

◆ val

T Uniform< T >.val
package

data value

Definition at line 30 of file Uniform.pde.


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