Click or drag to resize

Uniform Constructor

Creates a uniform.

Namespace:  Ooogles
Assembly:  Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public Uniform(
	Program program,
	string uniformName
)

Parameters

program
Type: OooglesProgram
the program containing the uniform.
uniformName
Type: SystemString
the (case-sensitive) name of the uniform as used in the vertex or fragment shader of the program.
Exceptions
ExceptionCondition
GLExceptionInvalidOperation if program is not a valid program or has not been successfully linked.
Remarks
uniformName must be an active uniform variable name in program that is not a structure, an array of structures, or a subcomponent of a vector or a matrix.

Uniform variables that are structures or arrays of structures may be queried by using separate Uniform classes for each field within the structure. The array element operator '[]' and the structure field operator '.' may be used in name in order to select elements within an array or fields within a structure. The result of using these operators is not allowed to be another structure, an array of structures, or a subcomponent of a vector or a matrix. Except if the last part of name indicates a uniform variable array, the location of the first element of an array can be retrieved by using the name of the array, or by using the name appended by '[0]'.

The actual locations assigned to uniform variables are not known until the program object is linked successfully.

Note: in DEBUG mode, a warning will be logged to the debug console if program does not contain a uniform named uniformName.

OpenGL API: glGetUniformLocation

See Also