NGL
6.5
The NCCA Graphics Library
|
#include <ShaderProgram.h>
Classes | |
struct | uniformData |
this structure holds information about the registered uniforms in the program id is the uniform location, name is the uniform name, type is the GLenum type More... | |
Public Member Functions | |||||
ShaderProgram (std::string _name) noexcept | |||||
create an OpenGL shader program it is initially empty and just has a name for id More... | |||||
~ShaderProgram () | |||||
dtor More... | |||||
void | use () noexcept | ||||
use this Shader object as the current Active shader once this is set it is active until unbind us called More... | |||||
void | unbind () noexcept | ||||
method to unbind the current Program Object this will set the shader to be the glUseProgram(0) default value More... | |||||
void | attachShader (Shader *_shader) noexcept | ||||
attach a shader to the ProgramObject More... | |||||
void | bindAttribute (GLuint index, const std::string &_attribName) noexcept | ||||
bind an attribute in the Program object to _index using attribname More... | |||||
void | bindFragDataLocation (GLuint index, const std::string &_attribName) noexcept | ||||
bind fragment output location in the Program object to _index using attribname More... | |||||
void | link () noexcept | ||||
link our program object with the attatched shaders if shader are not attached the program will report the linker errors More... | |||||
GLuint | getID () const noexcept | ||||
get the ProgramID for the Program More... | |||||
GLint | getUniformLocation (const char *_name) const noexcept | ||||
returns the ID of the uniform attribute called 'name'. More... | |||||
void | printActiveUniforms () const noexcept | ||||
lists the available uniforms for the shader (this was a pain because the compiler quietly gets rid of unused uniforms). method written by Richard Southern. More... | |||||
void | printActiveAttributes () const noexcept | ||||
lists the available Attributes for the shader (this was a pain because the compiler quietly gets rid of unused uniforms). method written by Richard Southern. More... | |||||
void | printProperties () const noexcept | ||||
calls the printActiveUniforms followed by Attribs method written by Richard Southern. More... | |||||
Set uniform argument values from the argument name | |||||
void | setUniform1f (const char *_varname, float __v0) const noexcept | ||||
sets '_varname' as a float More... | |||||
void | setRegisteredUniform1f (const std::string &_varname, float _v0) const noexcept | ||||
sets the registered uniform to a single float More... | |||||
void | setUniform2f (const char *_varname, float _v0, float _v1) const noexcept | ||||
sets '_varname' as a float2 More... | |||||
void | setRegisteredUniform2f (const std::string &_varname, float _v0, float _v1) const noexcept | ||||
sets the registered uniform to a single float More... | |||||
void | setUniform3f (const char *_varname, float _v0, float _v1, float _v2) const noexcept | ||||
sets '_varname' as a float3 More... | |||||
void | setRegisteredUniform3f (const std::string &_varname, float _v0, float _v1, float _v2) const noexcept | ||||
sets the registered uniform to a single float More... | |||||
void | setUniform4f (const char *_varname, float _v0, float _v1, float _v2, float _v3) const noexcept | ||||
sets '_varname' as a float4 More... | |||||
void | setRegisteredUniform4f (const std::string &_varname, float _v0, float _v1, float _v2, float _v3) const noexcept | ||||
sets the registered uniform to a single float More... | |||||
void | setUniform1fv (const char *_varname, size_t _count, const float *_value) const noexcept | ||||
sets '_varname' as a 1D float array More... | |||||
void | setUniform2fv (const char *_varname, size_t _count, const float *_value) const noexcept | ||||
sets '_varname' as a 2D float array More... | |||||
void | setUniform3fv (const char *_varname, size_t _count, const float *_value) const noexcept | ||||
sets '_varname' as a 3D float array More... | |||||
void | setUniform4fv (const char *_varname, size_t _count, const float *_value) const noexcept | ||||
sets '_varname' as a 4D float array More... | |||||
Set Program Integer Args | |||||
sets '_varname' as an int
| |||||
void | setUniform1i (const char *_varname, GLint _v0) const noexcept | ||||
void | setRegisteredUniform1i (const std::string &_varname, int _v0) const noexcept | ||||
sets the registered uniform to a single int More... | |||||
void | setRegisteredUniform2i (const std::string &_varname, int _v0, int _v1) const noexcept | ||||
sets the registered uniform to a single int More... | |||||
void | setRegisteredUniform3i (const std::string &_varname, int _v0, int _v1, int _v2) const noexcept | ||||
sets the registered uniform to a single int More... | |||||
void | setRegisteredUniform4i (const std::string &_varname, int _v0, int _v1, int _v2, int _v3) const noexcept | ||||
sets the registered uniform to a single int More... | |||||
void | setUniform2i (const char *_varname, GLint _v0, GLint _v1) const noexcept | ||||
sets '_varname' as a int2 More... | |||||
void | setUniform3i (const char *_varname, GLint _v0, GLint _v1, GLint _v2) const noexcept | ||||
sets '_varname' as a int3 More... | |||||
void | setUniform4i (const char *_varname, GLint _v0, GLint _v1, GLint _v2, GLint _v3) const noexcept | ||||
sets '_varname' as a float4 More... | |||||
void | setUniform1iv (const char *_varname, size_t _count, const GLint *_value) const noexcept | ||||
sets '_varname' as a 1D int array More... | |||||
void | setUniform2iv (const char *_varname, size_t _count, const GLint *_value) const noexcept | ||||
sets '_varname' as a 2D int array More... | |||||
void | setUniform3iv (const char *_varname, size_t _count, const GLint *_value) const noexcept | ||||
sets '_varname' as a 3D int array More... | |||||
void | setUniform4iv (const char *_varname, size_t _count, const GLint *_value) const noexcept | ||||
sets '_varname' as a 4D int array More... | |||||
Set Program Matrix Args | |||||
void | setUniformMatrix2fv (const char *_varname, size_t _count, bool _transpose, const float *_value) const noexcept | ||||
sets '_varname' as a 2D matrix array More... | |||||
void | setUniformMatrix3fv (const char *_varname, size_t _count, bool _transpose, const float *_value) const noexcept | ||||
sets '_varname' as a 3D matrix array More... | |||||
void | setRegisteredUniformMatrix3fv (const std::string &_varname, size_t _count, bool _transpose, const float *_value) const noexcept | ||||
sets '_varname' as a 3D matrix array More... | |||||
void | setUniformMatrix4fv (const char *_varname, size_t _count, bool _transpose, const float *_value) const noexcept | ||||
sets '_varname' as a 4D matrix array More... | |||||
void | setRegisteredUniformMatrix4fv (const std::string &_varname, size_t _count, bool _transpose, const float *_value) const noexcept | ||||
sets '_varname' as a 4D matrix array More... | |||||
Set Program Matrix Args (only available in OpenGL 2.1) | |||||
void | setUniformMatrix2x3fv (const char *_varname, size_t _count, bool _transpose, const float *_value) const noexcept | ||||
sets '_varname' as a 2x3 matrix array More... | |||||
void | setUniformMatrix2x4fv (const char *_varname, size_t _count, bool _transpose, const float *_value) const noexcept | ||||
sets '_varname' as a 2x4 matrix array More... | |||||
void | setUniformMatrix3x2fv (const char *_varname, size_t _count, bool _transpose, const float *_value) const noexcept | ||||
sets '_varname' as a 3x2 matrix array More... | |||||
void | setUniformMatrix3x4fv (const char *_varname, size_t _count, bool _transpose, const float *_value) const noexcept | ||||
sets '_varname' as a 3x4 matrix array More... | |||||
void | setUniformMatrix4x2fv (const char *_varname, size_t _count, bool _transpose, const float *_value) const noexcept | ||||
sets '_varname' as a 4x2 matrix array More... | |||||
void | setUniformMatrix4x3fv (const char *_varname, size_t _count, bool _transpose, const float *_value) const noexcept | ||||
sets '_varname' as a 4x3 matrix array More... | |||||
get program arguments | |||||
void | getUniformfv (const char *_name, float *o_values) const noexcept | ||||
gets the current value of the specified uniform var More... | |||||
void | getUniformiv (const char *_name, int *o_values) const noexcept | ||||
gets the current value of the specified uniform var More... | |||||
vertex array functions. | |
These functions simplify the binding of per-vertex data as a vertex array (or VBO). | |
bool | m_linked |
flag to indicate if the current Program has been linked More... | |
std::vector< Shader * > | m_shaders |
a list of the shader objects attached to the program More... | |
GLuint | m_programID |
the program id for this program object More... | |
bool | m_debugState |
debug mode flag More... | |
std::string | m_programName |
text name of the current program used in lookup and debugging More... | |
std::unordered_map< std::string, GLuint > | m_attribs |
a list of attributes for this object, mapping name to ID number More... | |
std::unordered_map< std::string, uniformData > | m_registeredUniforms |
a list of uniforms for this object, mapping name to ID number must be added by the user using the registerUniform method More... | |
bool | m_active |
indicate if this program is the current active program More... | |
void | enableAttribArray (const char *_name) const noexcept |
enables the specified varying array More... | |
void | disableAttribArray (const char *_name) const noexcept |
disables the specified varying array More... | |
void | autoRegisterUniforms () noexcept |
scan the shader source and find any uniforms and register them More... | |
void | printRegisteredUniforms () const noexcept |
debug print the registered uniforms More... | |
void | bindFragDataLocation (GLuint _colourNumber, const char *_name) noexcept |
bind the fragment shader output More... | |
GLuint | getUniformBlockIndex (const std::string &_uniformBlockName) const noexcept |
get the index of a uniform bloc More... | |
Definition at line 37 of file ShaderProgram.h.
|
noexcept |
create an OpenGL shader program it is initially empty and just has a name for id
_name | the name of the Program Object |
Definition at line 28 of file ShaderProgram.cpp.
References glCreateProgram.
ShaderProgram::~ShaderProgram | ( | ) |
dtor
Definition at line 46 of file ShaderProgram.cpp.
References glDeleteProgram, m_programID, and m_programName.
attach a shader to the ProgramObject
_shader | the Shader object to attach |
Definition at line 68 of file ShaderProgram.cpp.
References glAttachShader, m_programID, and m_shaders.
|
noexcept |
scan the shader source and find any uniforms and register them
Definition at line 538 of file ShaderProgram.cpp.
References fmt::format(), GL_ACTIVE_UNIFORMS, GL_ZERO, glGetActiveUniform, glGetProgramiv, glGetUniformLocation, ngl::ShaderProgram::uniformData::loc, m_programID, m_registeredUniforms, ngl::ShaderProgram::uniformData::name, and ngl::ShaderProgram::uniformData::type.
|
noexcept |
bind an attribute in the Program object to _index using attribname
_index | the index number we wish to bind to |
_attribName | the name of the attribute we wish to use |
Definition at line 75 of file ShaderProgram.cpp.
References glBindAttribLocation, m_attribs, m_linked, m_programID, and ngl::NGLCheckGLError().
|
noexcept |
bind fragment output location in the Program object to _index using attribname
_index | the index number we wish to bind to |
_attribName | the name of the attribute we wish to use |
Definition at line 87 of file ShaderProgram.cpp.
References glBindFragDataLocation, m_attribs, m_linked, m_programID, and ngl::NGLCheckGLError().
bind the fragment shader output
[in] | _colourNumber | The color number to bind the user-defined varying out variable to |
[in] | _name | the name of the output variable to bind |
Definition at line 525 of file ShaderProgram.cpp.
References glBindFragDataLocation, and m_programID.
|
noexcept |
disables the specified varying array
_name | - the name of the varying attr array to enable |
Definition at line 517 of file ShaderProgram.cpp.
References getUniformLocation(), and glDisableVertexAttribArray.
|
noexcept |
enables the specified varying array
_name | - the name of the varying attr array to enable |
Definition at line 503 of file ShaderProgram.cpp.
References glEnableVertexAttribArray, and m_attribs.
|
inlinenoexcept |
get the ProgramID for the Program
Definition at line 90 of file ShaderProgram.h.
|
noexcept |
get the index of a uniform bloc
[in] | _uniformBlockName | the name of the uniform block to get the id for |
Definition at line 532 of file ShaderProgram.cpp.
References glGetUniformBlockIndex, and m_programID.
|
noexcept |
gets the current value of the specified uniform var
_name | - name of the uniform variable to retrieve |
o_values | - the output value |
Definition at line 490 of file ShaderProgram.cpp.
References getUniformLocation(), glGetUniformfv, and m_programID.
gets the current value of the specified uniform var
_name | - name of the uniform variable to retrieve |
o_values | - the output value |
Definition at line 496 of file ShaderProgram.cpp.
References getUniformLocation(), glGetUniformiv, and m_programID.
|
noexcept |
returns the ID of the uniform attribute called 'name'.
Definition at line 138 of file ShaderProgram.cpp.
References glGetUniformLocation, m_programID, and m_programName.
|
noexcept |
link our program object with the attatched shaders if shader are not attached the program will report the linker errors
Definition at line 102 of file ShaderProgram.cpp.
References autoRegisterUniforms(), GL_FALSE, GL_INFO_LOG_LENGTH, GL_LINK_STATUS, glGetProgramInfoLog, glGetProgramiv, glLinkProgram, glUseProgram, m_debugState, m_linked, m_programID, and m_programName.
|
noexcept |
lists the available Attributes for the shader (this was a pain because the compiler quietly gets rid of unused uniforms). method written by Richard Southern.
Definition at line 178 of file ShaderProgram.cpp.
References GL_ACTIVE_ATTRIBUTES, GL_FLOAT, GL_FLOAT_MAT2, GL_FLOAT_MAT2x3, GL_FLOAT_MAT2x4, GL_FLOAT_MAT3, GL_FLOAT_MAT3x2, GL_FLOAT_MAT3x4, GL_FLOAT_MAT4, GL_FLOAT_MAT4x2, GL_FLOAT_MAT4x3, GL_FLOAT_VEC2, GL_FLOAT_VEC3, GL_FLOAT_VEC4, glGetActiveAttrib, glGetProgramiv, and m_programID.
|
noexcept |
lists the available uniforms for the shader (this was a pain because the compiler quietly gets rid of unused uniforms). method written by Richard Southern.
Definition at line 158 of file ShaderProgram.cpp.
References GL_ACTIVE_UNIFORMS, glGetActiveUniformName, glGetProgramiv, m_active, and m_programID.
|
noexcept |
calls the printActiveUniforms followed by Attribs method written by Richard Southern.
Definition at line 150 of file ShaderProgram.cpp.
References printActiveAttributes(), and printActiveUniforms().
|
noexcept |
debug print the registered uniforms
Definition at line 582 of file ShaderProgram.cpp.
References GL_BOOL, GL_BOOL_VEC2, GL_BOOL_VEC3, GL_BOOL_VEC4, GL_DOUBLE, GL_DOUBLE_MAT2, GL_DOUBLE_MAT2x3, GL_DOUBLE_MAT2x4, GL_DOUBLE_MAT3, GL_DOUBLE_MAT3x2, GL_DOUBLE_MAT3x4, GL_DOUBLE_MAT4, GL_DOUBLE_MAT4x2, GL_DOUBLE_MAT4x3, GL_DOUBLE_VEC2, GL_DOUBLE_VEC3, GL_DOUBLE_VEC4, GL_FLOAT, GL_FLOAT_MAT2, GL_FLOAT_MAT2x3, GL_FLOAT_MAT2x4, GL_FLOAT_MAT3, GL_FLOAT_MAT3x2, GL_FLOAT_MAT3x4, GL_FLOAT_MAT4, GL_FLOAT_MAT4x2, GL_FLOAT_MAT4x3, GL_FLOAT_VEC2, GL_FLOAT_VEC3, GL_FLOAT_VEC4, GL_IMAGE_1D, GL_IMAGE_1D_ARRAY, GL_IMAGE_2D, GL_IMAGE_2D_ARRAY, GL_IMAGE_2D_MULTISAMPLE, GL_IMAGE_2D_MULTISAMPLE_ARRAY, GL_IMAGE_2D_RECT, GL_IMAGE_3D, GL_IMAGE_BUFFER, GL_IMAGE_CUBE, GL_INT, GL_INT_IMAGE_1D, GL_INT_IMAGE_1D_ARRAY, GL_INT_IMAGE_2D, GL_INT_IMAGE_2D_ARRAY, GL_INT_IMAGE_2D_MULTISAMPLE, GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY, GL_INT_IMAGE_2D_RECT, GL_INT_IMAGE_3D, GL_INT_IMAGE_BUFFER, GL_INT_IMAGE_CUBE, GL_INT_SAMPLER_1D, GL_INT_SAMPLER_1D_ARRAY, GL_INT_SAMPLER_2D, GL_INT_SAMPLER_2D_ARRAY, GL_INT_SAMPLER_2D_MULTISAMPLE, GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, GL_INT_SAMPLER_2D_RECT, GL_INT_SAMPLER_3D, GL_INT_SAMPLER_BUFFER, GL_INT_SAMPLER_CUBE, GL_INT_VEC2, GL_INT_VEC3, GL_INT_VEC4, GL_SAMPLER_1D, GL_SAMPLER_1D_ARRAY, GL_SAMPLER_1D_ARRAY_SHADOW, GL_SAMPLER_1D_SHADOW, GL_SAMPLER_2D, GL_SAMPLER_2D_ARRAY, GL_SAMPLER_2D_ARRAY_SHADOW, GL_SAMPLER_2D_MULTISAMPLE, GL_SAMPLER_2D_MULTISAMPLE_ARRAY, GL_SAMPLER_2D_RECT, GL_SAMPLER_2D_RECT_SHADOW, GL_SAMPLER_2D_SHADOW, GL_SAMPLER_3D, GL_SAMPLER_BUFFER, GL_SAMPLER_CUBE, GL_SAMPLER_CUBE_SHADOW, GL_UNSIGNED_INT, GL_UNSIGNED_INT_ATOMIC_COUNTER, GL_UNSIGNED_INT_IMAGE_1D, GL_UNSIGNED_INT_IMAGE_1D_ARRAY, GL_UNSIGNED_INT_IMAGE_2D, GL_UNSIGNED_INT_IMAGE_2D_ARRAY, GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE, GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY, GL_UNSIGNED_INT_IMAGE_2D_RECT, GL_UNSIGNED_INT_IMAGE_3D, GL_UNSIGNED_INT_IMAGE_BUFFER, GL_UNSIGNED_INT_IMAGE_CUBE, GL_UNSIGNED_INT_SAMPLER_1D, GL_UNSIGNED_INT_SAMPLER_1D_ARRAY, GL_UNSIGNED_INT_SAMPLER_2D, GL_UNSIGNED_INT_SAMPLER_2D_ARRAY, GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE, GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, GL_UNSIGNED_INT_SAMPLER_2D_RECT, GL_UNSIGNED_INT_SAMPLER_3D, GL_UNSIGNED_INT_SAMPLER_BUFFER, GL_UNSIGNED_INT_SAMPLER_CUBE, GL_UNSIGNED_INT_VEC2, GL_UNSIGNED_INT_VEC3, GL_UNSIGNED_INT_VEC4, m_programName, and m_registeredUniforms.
|
noexcept |
sets the registered uniform to a single float
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
Definition at line 218 of file ShaderProgram.cpp.
References glUniform1f, and m_registeredUniforms.
|
noexcept |
sets the registered uniform to a single int
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
Definition at line 315 of file ShaderProgram.cpp.
References glUniform1i, and m_registeredUniforms.
|
noexcept |
sets the registered uniform to a single float
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
_v1 | - new value for the variable |
Definition at line 236 of file ShaderProgram.cpp.
References glUniform2f, and m_registeredUniforms.
|
noexcept |
sets the registered uniform to a single int
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
_v1 | - new value for the variable |
Definition at line 327 of file ShaderProgram.cpp.
References glUniform2i, and m_registeredUniforms.
|
noexcept |
sets the registered uniform to a single float
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
_v1 | - new value for the variable |
_v2 | - new value for the variable |
Definition at line 253 of file ShaderProgram.cpp.
References glUniform3f, and m_registeredUniforms.
|
noexcept |
sets the registered uniform to a single int
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
_v1 | - new value for the variable |
_v2 | - new value for the variable |
Definition at line 340 of file ShaderProgram.cpp.
References glUniform3i, and m_registeredUniforms.
|
noexcept |
sets the registered uniform to a single float
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
_v1 | - new value for the variable |
_v2 | - new value for the variable |
_v3 | - new value for the variable |
Definition at line 270 of file ShaderProgram.cpp.
References glUniform4f, and m_registeredUniforms.
|
noexcept |
sets the registered uniform to a single int
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
_v1 | - new value for the variable |
_v2 | - new value for the variable |
_v3 | - new value for the variable |
Definition at line 351 of file ShaderProgram.cpp.
References glUniform4i, and m_registeredUniforms.
|
noexcept |
sets '_varname' as a 3D matrix array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_transpose | - if true will transpose the matrix values |
_value | - new value for the variable |
Definition at line 418 of file ShaderProgram.cpp.
References glUniformMatrix3fv, and m_registeredUniforms.
|
noexcept |
sets '_varname' as a 4D matrix array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_transpose | - if true will transpose the matrix values |
_value | - new value for the variable |
Definition at line 436 of file ShaderProgram.cpp.
References glUniformMatrix4fv, and m_registeredUniforms.
|
noexcept |
sets '_varname' as a float
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
Definition at line 212 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform1f.
|
noexcept |
sets '_varname' as a 1D float array
_varname | - name of the uniform variable |
count | - num elements in the array |
value | - new value for the variable |
Definition at line 282 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform1fv.
Definition at line 308 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform1i.
|
noexcept |
sets '_varname' as a 1D int array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_value | - new value for the variable |
Definition at line 380 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform1iv.
|
noexcept |
sets '_varname' as a float2
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
_v1 | - new value for the variable |
Definition at line 229 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform2f.
|
noexcept |
sets '_varname' as a 2D float array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_value | - new _value for the variable |
Definition at line 288 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform2fv.
sets '_varname' as a int2
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
_v1 | - new value for the variable |
Definition at line 362 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform2i.
|
noexcept |
sets '_varname' as a 2D int array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_value | - new value for the variable |
Definition at line 386 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform2iv.
|
noexcept |
sets '_varname' as a float3
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
_v1 | - new value for the variable |
_v2 | - new value for the variable |
Definition at line 248 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform3f.
|
noexcept |
sets '_varname' as a 3D float array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_value | - new _value for the variable |
Definition at line 294 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform3fv.
|
noexcept |
sets '_varname' as a int3
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
_v1 | - new value for the variable |
_v2 | - new value for the variable |
Definition at line 368 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform3i.
|
noexcept |
sets '_varname' as a 3D int array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_value | - new value for the variable |
Definition at line 391 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform3iv.
|
noexcept |
sets '_varname' as a float4
_varname | - name of the uniform variable |
_v0 | - new value for the variable |
_v1 | - new value for the variable |
_v2 | - new value for the variable |
_v3 | - new value for the variable |
Definition at line 264 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform4f.
|
noexcept |
sets '_varname' as a 4D float array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_value | - new _value for the variable |
Definition at line 300 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform4fv.
|
noexcept |
sets '_varname' as a float4
_varname | -name of the uniform variable |
_v0 | - new value for the variable |
_v1 | - new value for the variable |
_v2 | - new value for the variable |
_v3 | - new value for the variable |
Definition at line 374 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform4i.
|
noexcept |
sets '_varname' as a 4D int array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_value | - new _value for the variable |
Definition at line 397 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniform4iv.
|
noexcept |
sets '_varname' as a 2D matrix array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_transpose | - if true will transpose the matrix values |
_value | - new value for the variable |
Definition at line 404 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniformMatrix2fv.
|
noexcept |
sets '_varname' as a 2x3 matrix array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_transpose | - if true will transpose the matrix values |
_value | - new value for the variable |
Definition at line 451 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniformMatrix2x3fv.
|
noexcept |
sets '_varname' as a 2x4 matrix array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_transpose | - if true will transpose the matrix values |
_value | - new value for the variable |
Definition at line 457 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniformMatrix2x4fv.
|
noexcept |
sets '_varname' as a 3D matrix array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_transpose | - if true will transpose the matrix values |
_value | - new value for the variable |
Definition at line 410 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniformMatrix3fv.
|
noexcept |
sets '_varname' as a 3x2 matrix array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_transpose | - if true will transpose the matrix values |
_value | - new value for the variable |
Definition at line 463 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniformMatrix3x2fv.
|
noexcept |
sets '_varname' as a 3x4 matrix array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_transpose | - if true will transpose the matrix values |
_value | - new value for the variable |
Definition at line 470 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniformMatrix3x4fv.
|
noexcept |
sets '_varname' as a 4D matrix array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_transpose | - if true will transpose the matrix values |
_value | - new value for the variable |
Definition at line 429 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniformMatrix4fv.
|
noexcept |
sets '_varname' as a 4x2 matrix array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_transpose | - if true will transpose the matrix values |
_value | - new value for the variable |
Definition at line 476 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniformMatrix4x2fv.
|
noexcept |
sets '_varname' as a 4x3 matrix array
_varname | - name of the uniform variable |
_count | - num elements in the array |
_transpose | - if true will transpose the matrix values |
_value | - new value for the variable |
Definition at line 483 of file ShaderProgram.cpp.
References getUniformLocation(), and glUniformMatrix4x3fv.
|
noexcept |
method to unbind the current Program Object this will set the shader to be the glUseProgram(0) default value
Definition at line 61 of file ShaderProgram.cpp.
References glUseProgram, and m_active.
|
noexcept |
use this Shader object as the current Active shader once this is set it is active until unbind us called
Definition at line 52 of file ShaderProgram.cpp.
References glUseProgram, m_active, and m_programID.
|
private |
indicate if this program is the current active program
Definition at line 523 of file ShaderProgram.h.
|
private |
a list of attributes for this object, mapping name to ID number
Definition at line 502 of file ShaderProgram.h.
|
private |
debug mode flag
Definition at line 494 of file ShaderProgram.h.
|
private |
flag to indicate if the current Program has been linked
Definition at line 482 of file ShaderProgram.h.
|
private |
the program id for this program object
Definition at line 490 of file ShaderProgram.h.
|
private |
text name of the current program used in lookup and debugging
Definition at line 498 of file ShaderProgram.h.
|
private |
a list of uniforms for this object, mapping name to ID number must be added by the user using the registerUniform method
Definition at line 519 of file ShaderProgram.h.
|
private |
a list of the shader objects attached to the program
Definition at line 486 of file ShaderProgram.h.