OpenGlShader

Undocumented in source.

Constructors

this
this(Source[] codes)

Constructs the shader object by calling glCreateProgram, then compiling each given Source, and finally, linking them together.

Members

Functions

delete_
void delete_()

Deletes the program.

use
void use()

Calls glUseProgram(this.shaderProgram)

Properties

shaderProgram
int shaderProgram [@property getter]

Get the program ID for use in OpenGL functions.

uniforms
UniformsHelper uniforms [@property getter]

Gives access to the uniforms through dot access. `OpenGlShader.Uniform = shader.uniforms.foo; // calls glGetUniformLocation(this, "foo");

Static functions

compile
void compile(int sid, Source code)

Helper method to just compile some shader code and check for errors while you do glCreateShader, etc. on the outside yourself.

link
void link(int shaderProgram)

Calls glLinkProgram and throws if error a occurs.

Structs

Source
struct Source
Uniform
struct Uniform

OpenGlShader.uniforms.name gives you one of these.

Meta