Clutter Engine 0.0.1
|
Represents an OpenGL shader program composed of multiple shaders. More...
#include <ShaderProgram.h>
Public Member Functions | |
ShaderProgram () | |
Constructs an empty ShaderProgram. | |
~ShaderProgram ()=default | |
Destroys the ShaderProgram. | |
void | Unload () |
Unloads the shader program and releases resources. | |
void | Compose (std::vector< Shader * > shaders) |
Composes the shader program from a list of shaders. | |
GLuint | GetID () const |
Gets the OpenGL program ID. | |
void | Use () |
Activates the shader program for use. | |
void | SetBool (const GLchar *pName, GLboolean pValue) |
Sets a boolean uniform variable. | |
void | SetInt (const GLchar *pName, GLint pValue) |
Sets an integer uniform variable. | |
void | SetFloat (const GLchar *pName, GLfloat pValue) |
Sets a float uniform variable. | |
void | SetVec2f (const GLchar *pName, const Vector2 &pValue) |
Sets a vec2 uniform variable using a Vector2. | |
void | SetVec2f (const GLchar *pName, GLfloat pX, GLfloat pY) |
Sets a vec2 uniform variable using two floats. | |
void | SetVec3f (const GLchar *pName, const Vector3 &pValue) |
Sets a vec3 uniform variable using a Vector3. | |
void | SetVec3f (const GLchar *pName, const Color &pValue) |
Sets a vec3 uniform variable using a Color. | |
void | SetVec3f (const GLchar *pName, GLfloat pX, GLfloat pY, GLfloat pZ) |
Sets a vec3 uniform variable using three floats. | |
void | SetVec4f (const GLchar *pName, const Vector4 &pValue) |
Sets a vec4 uniform variable using a Vector4. | |
void | SetVec4f (const GLchar *pName, const Color &pValue) |
Sets a vec4 uniform variable using a Color. | |
void | SetVec4f (const GLchar *pName, GLfloat pX, GLfloat pY, GLfloat pZ, GLfloat pW) |
Sets a vec4 uniform variable using four floats. | |
void | SetMat2 (const GLchar *pName, const glm::mat2 &pMatrix) |
Sets a mat2 uniform variable. | |
void | SetMat3 (const GLchar *pName, const glm::mat3 &pMatrix) |
Sets a mat3 uniform variable. | |
void | SetMat4 (const GLchar *pName, const Matrix4 &pMatrix) |
Sets a mat4 uniform variable using Matrix4. | |
void | SetMat4Row (const GLchar *pName, const Matrix4Row &pMatrix) |
Sets a mat4 uniform variable using Matrix4Row. | |
Represents an OpenGL shader program composed of multiple shaders.
Provides methods to compose, use, and set uniform variables for the shader program.
void ShaderProgram::Compose | ( | std::vector< Shader * > | shaders | ) |
Composes the shader program from a list of shaders.
shaders | Vector of pointers to Shader objects. |
|
inline |
Gets the OpenGL program ID.
void ShaderProgram::SetBool | ( | const GLchar * | pName, |
GLboolean | pValue ) |
Sets a boolean uniform variable.
pName | Name of the uniform variable. |
pValue | Boolean value to set. |
void ShaderProgram::SetFloat | ( | const GLchar * | pName, |
GLfloat | pValue ) |
Sets a float uniform variable.
pName | Name of the uniform variable. |
pValue | Float value to set. |
void ShaderProgram::SetInt | ( | const GLchar * | pName, |
GLint | pValue ) |
Sets an integer uniform variable.
pName | Name of the uniform variable. |
pValue | Integer value to set. |
void ShaderProgram::SetMat2 | ( | const GLchar * | pName, |
const glm::mat2 & | pMatrix ) |
Sets a mat2 uniform variable.
pName | Name of the uniform variable. |
pMatrix | 2x2 matrix value to set. |
void ShaderProgram::SetMat3 | ( | const GLchar * | pName, |
const glm::mat3 & | pMatrix ) |
Sets a mat3 uniform variable.
pName | Name of the uniform variable. |
pMatrix | 3x3 matrix value to set. |
void ShaderProgram::SetMat4 | ( | const GLchar * | pName, |
const Matrix4 & | pMatrix ) |
Sets a mat4 uniform variable using Matrix4.
pName | Name of the uniform variable. |
pMatrix | 4x4 matrix value to set. |
void ShaderProgram::SetMat4Row | ( | const GLchar * | pName, |
const Matrix4Row & | pMatrix ) |
Sets a mat4 uniform variable using Matrix4Row.
pName | Name of the uniform variable. |
pMatrix | 4x4 row-major matrix value to set. |
void ShaderProgram::SetVec2f | ( | const GLchar * | pName, |
const Vector2 & | pValue ) |
void ShaderProgram::SetVec2f | ( | const GLchar * | pName, |
GLfloat | pX, | ||
GLfloat | pY ) |
Sets a vec2 uniform variable using two floats.
pName | Name of the uniform variable. |
pX | X component. |
pY | Y component. |
void ShaderProgram::SetVec3f | ( | const GLchar * | pName, |
const Color & | pValue ) |
void ShaderProgram::SetVec3f | ( | const GLchar * | pName, |
const Vector3 & | pValue ) |
void ShaderProgram::SetVec3f | ( | const GLchar * | pName, |
GLfloat | pX, | ||
GLfloat | pY, | ||
GLfloat | pZ ) |
Sets a vec3 uniform variable using three floats.
pName | Name of the uniform variable. |
pX | X component. |
pY | Y component. |
pZ | Z component. |
void ShaderProgram::SetVec4f | ( | const GLchar * | pName, |
const Color & | pValue ) |
void ShaderProgram::SetVec4f | ( | const GLchar * | pName, |
const Vector4 & | pValue ) |
void ShaderProgram::SetVec4f | ( | const GLchar * | pName, |
GLfloat | pX, | ||
GLfloat | pY, | ||
GLfloat | pZ, | ||
GLfloat | pW ) |
Sets a vec4 uniform variable using four floats.
pName | Name of the uniform variable. |
pX | X component. |
pY | Y component. |
pZ | Z component. |
pW | W component. |