GLUniform

Represents an OpenGL program uniform. Owned by a GLProgram. Both uniform locations and values are cached, to minimize OpenGL calls.

Constructors

this
this(GLuint program, GLenum type, string name, GLsizei size)

Creates a GLUniform. This is done automatically after linking a GLProgram.

this
this(string name)

Creates a fake disabled uniform variable, designed to cope with variables that have been optimized out by the OpenGL driver, or those which do not exist.

Members

Functions

logger
void logger(Logger l)

Sets a logger for the program. That allows additional output besides error reporting.

name
string name()
set
void set(T newValue)

Sets a uniform variable value. T should be the exact type needed, checked at runtime.

set
void set(T[] newValues)

Sets multiple uniform variables.

set
void set(T* newValues, size_t count)

Sets multiple uniform variables.

unuse
void unuse()

Unuses this uniform.

use
void use()

Updates the uniform value.

Static functions

sizeOfUniformType
size_t sizeOfUniformType(GLenum type)
Undocumented in source. Be warned that the author may not have intended to support it.
typeIsCompliant
bool typeIsCompliant(GLenum type)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta