Manages an OpenGL shader program. More...
Classes | |
| struct | Attribute |
| Represents an openGL vertex attribute value. More... | |
| struct | Uniform |
| Represents an openGL uniform value. More... | |
Public Member Functions | |
| OpenGLShaderProgram (const OpenGLContext &context) noexcept | |
| ~OpenGLShaderProgram () noexcept | |
| bool | addShader (const char *const shaderSourceCode, GLenum shaderType) |
| Compiles and adds a shader to this program. | |
| bool | link () noexcept |
| Links all the compiled shaders into a usable program. | |
| const String & | getLastError () const noexcept |
| Get the output for the last shader compilation or link that failed. | |
| void | use () const noexcept |
| Selects this program into the current context. | |
Static Public Member Functions | |
| static double | getLanguageVersion () |
| Returns the version of GLSL that the current context supports. | |
Public Attributes | |
| GLuint | programID |
| The ID number of the compiled program. | |
Manages an OpenGL shader program.
|
noexcept |
|
noexcept |
|
static |
Returns the version of GLSL that the current context supports.
E.g.
| bool OpenGLShaderProgram::addShader | ( | const char *const | shaderSourceCode, |
| GLenum | shaderType | ||
| ) |
Compiles and adds a shader to this program.
After adding all your shaders, remember to call link() to link them into a usable program.
If your app is built in debug mode, this method will assert if the program fails to compile correctly.
The shaderType parameter could be GL_VERTEX_SHADER, GL_FRAGMENT_SHADER, etc.
|
noexcept |
Links all the compiled shaders into a usable program.
If your app is built in debug mode, this method will assert if the program fails to link correctly.
|
noexcept |
Get the output for the last shader compilation or link that failed.
|
noexcept |
Selects this program into the current context.
| GLuint OpenGLShaderProgram::programID |
The ID number of the compiled program.