CSCI441 OpenGL Library 5.9.0
CS@Mines CSCI441 Computer Graphics Course Library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
CSCI441::ShaderProgram Class Reference

Handles registration and compilation of Shaders. More...

#include <ShaderProgram.hpp>

Inheritance diagram for CSCI441::ShaderProgram:
CSCI441::ComputeShaderProgram

Public Member Functions

 ShaderProgram (const char *vertexShaderFilename, const char *fragmentShaderFilename)
 Creates a Shader Program using a Vertex Shader and Fragment Shader.
 
 ShaderProgram (const char *vertexShaderFilename, const char *fragmentShaderFilename, bool isSeparable)
 Creates a Shader Program using a Vertex Shader and Fragment Shader.
 
 ShaderProgram (const char *vertexShaderFilename, const char *tessellationControlShaderFilename, const char *tessellationEvaluationShaderFilename, const char *geometryShaderFilename, const char *fragmentShaderFilename)
 Creates a Shader Program using a Vertex Shader, Tessellation Shader, Geometry Shader, and Fragment Shader.
 
 ShaderProgram (const char *vertexShaderFilename, const char *tessellationControlShaderFilename, const char *tessellationEvaluationShaderFilename, const char *geometryShaderFilename, const char *fragmentShaderFilename, bool isSeparable)
 Creates a Shader Program using a Vertex Shader, Tessellation Shader, Geometry Shader, and Fragment Shader.
 
 ShaderProgram (const char *vertexShaderFilename, const char *tessellationControlShaderFilename, const char *tessellationEvaluationShaderFilename, const char *fragmentShaderFilename)
 Creates a Shader Program using a Vertex Shader, Tessellation Shader, and Fragment Shader.
 
 ShaderProgram (const char *vertexShaderFilename, const char *tessellationControlShaderFilename, const char *tessellationEvaluationShaderFilename, const char *fragmentShaderFilename, bool isSeparable)
 Creates a Shader Program using a Vertex Shader, Tessellation Shader, and Fragment Shader.
 
 ShaderProgram (const char *vertexShaderFilename, const char *geometryShaderFilename, const char *fragmentShaderFilename)
 Creates a Shader Program using a Vertex Shader, Geometry Shader, and Fragment Shader.
 
 ShaderProgram (const char *vertexShaderFilename, const char *geometryShaderFilename, const char *fragmentShaderFilename, bool isSeparable)
 Creates a Shader Program using a Vertex Shader, Geometry Shader, and Fragment Shader.
 
 ShaderProgram (const char **shaderFilenames, bool vertexPresent, bool tessellationPresent, bool geometryPresent, bool fragmentPresent, bool isSeparable)
 Creates a Shader Program using any combination of shaders. Intended to be used to create separable programs but can be used as an alternative to the above overloaded constructors to explicitly state which shaders are present.
 
virtual ~ShaderProgram ()
 Clean up memory associated with the Shader Program.
 
 ShaderProgram (const ShaderProgram &)=delete
 do not allow shader programs to be copied
 
ShaderProgramoperator= (const ShaderProgram &)=delete
 do not allow shader programs to be copied
 
virtual bool writeShaderProgramBinaryToFile (const char *BINARY_FILE_NAME) const final
 writes precompiled shader program binary to external file
 
virtual GLint getUniformLocation (const char *uniformName) const final
 Returns the location of the given uniform in this shader program.
 
virtual GLint getUniformBlockIndex (const char *uniformBlockName) const final
 Returns the index of the given uniform block in this shader program.
 
virtual GLint getUniformBlockSize (const char *uniformBlockName) const final
 Returns the size of the given uniform block in this shader program.
 
virtual GLubyte * getUniformBlockBuffer (const char *uniformBlockName) const final
 Returns an allocated buffer for the given uniform block in this shader program.
 
virtual GLint * getUniformBlockOffsets (const char *uniformBlockName) const final
 Returns an array of offsets into the buffer for the given uniform block in this shader program.
 
virtual GLint * getUniformBlockOffsets (const char *uniformBlockName, const char *names[]) const final
 Returns an array of offsets into the buffer for the given uniform block and names in this shader program.
 
virtual GLint * getUniformBlockOffsets (GLint uniformBlockIndex) const final
 Returns an array of offsets into the buffer for the given uniform block in this shader program.
 
virtual GLint * getUniformBlockOffsets (GLint uniformBlockIndex, const char *names[]) const final
 Returns an array of offsets into the buffer for the given uniform block and names in this shader program.
 
virtual void setUniformBlockBinding (const char *uniformBlockName, GLuint binding) const final
 Set the binding point for the given uniform block in this shader program.
 
virtual GLint getAttributeLocation (const char *attributeName) const final
 Returns the location of the given attribute in this shader program.
 
virtual GLuint getSubroutineIndex (GLenum shaderStage, const char *subroutineName) const final
 Returns the index of the given subroutine for a shader stage in this shader program.
 
virtual GLint getImageBinding (const char *imageName) const final
 Returns the binding point for the corresponding image uniform.
 
virtual GLint getShaderStorageBlockBinding (const char *ssboName) const final
 Returns the binding point for the corresponding shader storage block.
 
virtual GLint getAtomicCounterBufferBinding (const char *atomicName) const final
 Returns the binding point for the corresponding atomic counter buffer.
 
virtual GLint getAtomicCounterBufferOffset (const char *atomicName) const final
 Returns the offset into the buffer for the corresponding atomic counter buffer.
 
virtual GLint getAtomicCounterBufferSize (const char *atomicName) const final
 Returns the full buffer size for the corresponding atomic counter buffer.
 
virtual GLuint getNumUniforms () const final
 Returns the number of active uniforms in this shader program.
 
virtual GLuint getNumUniformBlocks () const final
 Returns the number of active uniform blocks in this shader program.
 
virtual GLuint getNumAttributes () const final
 Returns the number of active attributes in this shader program.
 
virtual GLuint getShaderProgramHandle () const final
 Returns the handle for this shader program.
 
virtual void useProgram () const final
 Sets the Shader Program to be active.
 
virtual void setProgramUniform (const char *uniformName, GLfloat v0) const final
 sets the program uniform consisting of one float
 
virtual void setProgramUniform (const char *uniformName, GLint v0) const final
 sets the program uniform consisting of one integer
 
virtual void setProgramUniform (const char *uniformName, GLuint v0) const final
 sets the program uniform consisting of one unsigned integer
 
virtual void setProgramUniform (const char *uniformName, glm::mat2 mtx) const final
 sets the program uniform consisting of one 2x2 matrix
 
virtual void setProgramUniform (const char *uniformName, glm::mat3 mtx) const final
 sets the program uniform consisting of one 3x3 matrix
 
virtual void setProgramUniform (const char *uniformName, glm::mat4 mtx) const final
 sets the program uniform consisting of one 4x4 matrix
 
virtual void setProgramUniform (const char *uniformName, glm::mat2x3 mtx) const final
 sets the program uniform consisting of one 2x3 matrix
 
virtual void setProgramUniform (const char *uniformName, glm::mat3x2 mtx) const final
 sets the program uniform consisting of one 3x2 matrix
 
virtual void setProgramUniform (const char *uniformName, glm::mat2x4 mtx) const final
 sets the program uniform consisting of one 2x4 matrix
 
virtual void setProgramUniform (const char *uniformName, glm::mat4x2 mtx) const final
 sets the program uniform consisting of one 4x2 matrix
 
virtual void setProgramUniform (const char *uniformName, glm::mat3x4 mtx) const final
 sets the program uniform consisting of one 3x4 matrix
 
virtual void setProgramUniform (const char *uniformName, glm::mat4x3 mtx) const final
 sets the program uniform consisting of one 4x3 matrix
 
virtual void setProgramUniform (const char *uniformName, GLfloat v0, GLfloat v1) const final
 sets the program uniform consisting of two floats
 
virtual void setProgramUniform (const char *uniformName, GLint v0, GLint v1) const final
 sets the program uniform consisting of two integers
 
virtual void setProgramUniform (const char *uniformName, GLuint v0, GLuint v1) const final
 sets the program uniform consisting of two unsigned integers
 
virtual void setProgramUniform (const char *uniformName, GLfloat v0, GLfloat v1, GLfloat v2) const final
 sets the program uniform consisting of three floats
 
virtual void setProgramUniform (const char *uniformName, GLint v0, GLint v1, GLint v2) const final
 sets the program uniform consisting of three integers
 
virtual void setProgramUniform (const char *uniformName, GLuint v0, GLuint v1, GLuint v2) const final
 sets the program uniform consisting of three unsigned integers
 
virtual void setProgramUniform (const char *uniformName, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) const final
 sets the program uniform consisting of four floats
 
virtual void setProgramUniform (const char *uniformName, GLint v0, GLint v1, GLint v2, GLint v3) const final
 sets the program uniform consisting of four integers
 
virtual void setProgramUniform (const char *uniformName, GLuint v0, GLuint v1, GLuint v2, GLuint v3) const final
 sets the program uniform consisting of four unsigned integers
 
virtual void setProgramUniform (const char *uniformName, glm::vec2 value) const final
 sets the program uniform consisting of two floats
 
virtual void setProgramUniform (const char *uniformName, glm::ivec2 value) const final
 sets the program uniform consisting of two integers
 
virtual void setProgramUniform (const char *uniformName, glm::uvec2 value) const final
 sets the program uniform consisting of two unsigned integers
 
virtual void setProgramUniform (const char *uniformName, glm::vec3 value) const final
 sets the program uniform consisting of three floats
 
virtual void setProgramUniform (const char *uniformName, glm::ivec3 value) const final
 sets the program uniform consisting of three integers
 
virtual void setProgramUniform (const char *uniformName, glm::uvec3 value) const final
 sets the program uniform consisting of three unsigned integers
 
virtual void setProgramUniform (const char *uniformName, glm::vec4 value) const final
 sets the program uniform consisting of four floats
 
virtual void setProgramUniform (const char *uniformName, glm::ivec4 value) const final
 sets the program uniform consisting of four integers
 
virtual void setProgramUniform (const char *uniformName, glm::uvec4 value) const final
 sets the program uniform consisting of four unsigned integers
 
virtual void setProgramUniform (const char *uniformName, GLuint dim, GLsizei count, const GLfloat *value) const final
 sets the program uniform consisting of floats
 
virtual void setProgramUniform (const char *uniformName, GLuint dim, GLsizei count, const GLint *value) const final
 sets the program uniform consisting of integers
 
virtual void setProgramUniform (const char *uniformName, GLuint dim, GLsizei count, const GLuint *value) const final
 sets the program uniform consisting of unsigned integers
 
virtual void setProgramUniform (GLint uniformLocation, GLfloat v0) const final
 sets the program uniform consisting of one float
 
virtual void setProgramUniform (GLint uniformLocation, GLint v0) const final
 sets the program uniform consisting of one integer
 
virtual void setProgramUniform (GLint uniformLocation, GLuint v0) const final
 sets the program uniform consisting of one unsigned integer
 
virtual void setProgramUniform (GLint uniformLocation, glm::mat2 mtx) const final
 sets the program uniform consisting of one 2x2 matrix
 
virtual void setProgramUniform (GLint uniformLocation, glm::mat3 mtx) const final
 sets the program uniform consisting of one 3x3 matrix
 
virtual void setProgramUniform (GLint uniformLocation, glm::mat4 mtx) const final
 sets the program uniform consisting of one 4x4 matrix
 
virtual void setProgramUniform (GLint uniformLocation, glm::mat2x3 mtx) const final
 sets the program uniform consisting of one 2x3 matrix
 
virtual void setProgramUniform (GLint uniformLocation, glm::mat3x2 mtx) const final
 sets the program uniform consisting of one 3x2 matrix
 
virtual void setProgramUniform (GLint uniformLocation, glm::mat2x4 mtx) const final
 sets the program uniform consisting of one 2x4 matrix
 
virtual void setProgramUniform (GLint uniformLocation, glm::mat4x2 mtx) const final
 sets the program uniform consisting of one 4x2 matrix
 
virtual void setProgramUniform (GLint uniformLocation, glm::mat3x4 mtx) const final
 sets the program uniform consisting of one 3x4 matrix
 
virtual void setProgramUniform (GLint uniformLocation, glm::mat4x3 mtx) const final
 sets the program uniform consisting of one 4x3 matrix
 
virtual void setProgramUniform (GLint uniformLocation, GLfloat v0, GLfloat v1) const final
 sets the program uniform consisting of two floats
 
virtual void setProgramUniform (GLint uniformLocation, GLint v0, GLint v1) const final
 sets the program uniform consisting of two integers
 
virtual void setProgramUniform (GLint uniformLocation, GLuint v0, GLuint v1) const final
 sets the program uniform consisting of two unsigned integers
 
virtual void setProgramUniform (GLint uniformLocation, GLfloat v0, GLfloat v1, GLfloat v2) const final
 sets the program uniform consisting of three floats
 
virtual void setProgramUniform (GLint uniformLocation, GLint v0, GLint v1, GLint v2) const final
 sets the program uniform consisting of three integers
 
virtual void setProgramUniform (GLint uniformLocation, GLuint v0, GLuint v1, GLuint v2) const final
 sets the program uniform consisting of three unsigned integers
 
virtual void setProgramUniform (GLint uniformLocation, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) const final
 sets the program uniform consisting of four floats
 
virtual void setProgramUniform (GLint uniformLocation, GLint v0, GLint v1, GLint v2, GLint v3) const final
 sets the program uniform consisting of four integers
 
virtual void setProgramUniform (GLint uniformLocation, GLuint v0, GLuint v1, GLuint v2, GLuint v3) const final
 sets the program uniform consisting of four unsigned integers
 
virtual void setProgramUniform (GLint uniformLocation, glm::vec2 value) const final
 sets the program uniform consisting of two floats
 
virtual void setProgramUniform (GLint uniformLocation, glm::ivec2 value) const final
 sets the program uniform consisting of two integers
 
virtual void setProgramUniform (GLint uniformLocation, glm::uvec2 value) const final
 sets the program uniform consisting of two unsigned integers
 
virtual void setProgramUniform (GLint uniformLocation, glm::vec3 value) const final
 sets the program uniform consisting of three floats
 
virtual void setProgramUniform (GLint uniformLocation, glm::ivec3 value) const final
 sets the program uniform consisting of three integers
 
virtual void setProgramUniform (GLint uniformLocation, glm::uvec3 value) const final
 sets the program uniform consisting of three unsigned integers
 
virtual void setProgramUniform (GLint uniformLocation, glm::vec4 value) const final
 sets the program uniform consisting of four floats
 
virtual void setProgramUniform (GLint uniformLocation, glm::ivec4 value) const final
 sets the program uniform consisting of four integers
 
virtual void setProgramUniform (GLint uniformLocation, glm::uvec4 value) const final
 sets the program uniform consisting of four unsigned integers
 
virtual void setProgramUniform (GLint uniformLocation, GLuint dim, GLsizei count, const GLfloat *value) const final
 sets the program uniform consisting of floats
 
virtual void setProgramUniform (GLint uniformLocation, GLuint dim, GLsizei count, const GLint *value) const final
 sets the program uniform consisting of integers
 
virtual void setProgramUniform (GLint uniformLocation, GLuint dim, GLsizei count, const GLuint *value) const final
 sets the program uniform consisting of unsigned integers
 
virtual GLbitfield getProgramStages () const final
 returns a single value corresponding to which shader stages are present in this shader program
 

Static Public Member Functions

static void enableDebugMessages ()
 Enables debug messages from Shader Program functions.
 
static void disableDebugMessages ()
 Disables debug messages from Shader Program functions.
 
static ShaderProgramloadShaderProgramFromBinaryFile (const char *BINARY_FILE_NAME, GLenum format)
 loads precompiled shader program binary from external file
 

Protected Member Functions

 ShaderProgram ()
 creates an empty shader program object
 
virtual bool mRegisterShaderProgram (const char *vertexShaderFilename, const char *tessellationControlShaderFilename, const char *tessellationEvaluationShaderFilename, const char *geometryShaderFilename, const char *fragmentShaderFilename, bool isSeparable) final
 registers a shader program with the GPU
 

Protected Attributes

GLuint mVertexShaderHandle
 handle to the vertex shader stage
 
GLuint mTessellationControlShaderHandle
 handle to the tessellation control shader stage
 
GLuint mTessellationEvaluationShaderHandle
 handle to the tessellation evaluation shader stage
 
GLuint mGeometryShaderHandle
 handle to the geometry shader stage
 
GLuint mFragmentShaderHandle
 handle to the fragment shader stage
 
GLuint mShaderProgramHandle
 handle to the shader program
 
std::map< std::string, GLint > * mpUniformLocationsMap
 caches locations of uniform names within shader program
 
std::map< std::string, GLint > * mpAttributeLocationsMap
 caches locations of attribute names within shader program
 

Static Protected Attributes

static bool sDEBUG = true
 if DEBUG information should be printed or not
 

Detailed Description

Handles registration and compilation of Shaders.

Constructor & Destructor Documentation

◆ ShaderProgram() [1/9]

CSCI441::ShaderProgram::ShaderProgram ( const char *  vertexShaderFilename,
const char *  fragmentShaderFilename 
)
inline

Creates a Shader Program using a Vertex Shader and Fragment Shader.

Parameters
vertexShaderFilenamename of the file corresponding to the vertex shader
fragmentShaderFilenamename of the file corresponding to the fragment shader

◆ ShaderProgram() [2/9]

CSCI441::ShaderProgram::ShaderProgram ( const char *  vertexShaderFilename,
const char *  fragmentShaderFilename,
bool  isSeparable 
)
inline

Creates a Shader Program using a Vertex Shader and Fragment Shader.

Parameters
vertexShaderFilenamename of the file corresponding to the vertex shader
fragmentShaderFilenamename of the file corresponding to the fragment shader
isSeparableif program is separable

◆ ShaderProgram() [3/9]

CSCI441::ShaderProgram::ShaderProgram ( const char *  vertexShaderFilename,
const char *  tessellationControlShaderFilename,
const char *  tessellationEvaluationShaderFilename,
const char *  geometryShaderFilename,
const char *  fragmentShaderFilename 
)
inline

Creates a Shader Program using a Vertex Shader, Tessellation Shader, Geometry Shader, and Fragment Shader.

Parameters
vertexShaderFilenamename of the file corresponding to the vertex shader
tessellationControlShaderFilenamename of the file corresponding to the tessellation control shader
tessellationEvaluationShaderFilenamename of the file corresponding to the tessellation evaluation shader
geometryShaderFilenamename of the file corresponding to the geometry shader
fragmentShaderFilenamename of the file corresponding to the fragment shader

◆ ShaderProgram() [4/9]

CSCI441::ShaderProgram::ShaderProgram ( const char *  vertexShaderFilename,
const char *  tessellationControlShaderFilename,
const char *  tessellationEvaluationShaderFilename,
const char *  geometryShaderFilename,
const char *  fragmentShaderFilename,
bool  isSeparable 
)
inline

Creates a Shader Program using a Vertex Shader, Tessellation Shader, Geometry Shader, and Fragment Shader.

Parameters
vertexShaderFilenamename of the file corresponding to the vertex shader
tessellationControlShaderFilenamename of the file corresponding to the tessellation control shader
tessellationEvaluationShaderFilenamename of the file corresponding to the tessellation evaluation shader
geometryShaderFilenamename of the file corresponding to the geometry shader
fragmentShaderFilenamename of the file corresponding to the fragment shader
isSeparableif program is separable

◆ ShaderProgram() [5/9]

CSCI441::ShaderProgram::ShaderProgram ( const char *  vertexShaderFilename,
const char *  tessellationControlShaderFilename,
const char *  tessellationEvaluationShaderFilename,
const char *  fragmentShaderFilename 
)
inline

Creates a Shader Program using a Vertex Shader, Tessellation Shader, and Fragment Shader.

Parameters
vertexShaderFilenamename of the file corresponding to the vertex shader
tessellationControlShaderFilenamename of the file corresponding to the tessellation control shader
tessellationEvaluationShaderFilenamename of the file corresponding to the tessellation evaluation shader
fragmentShaderFilenamename of the file corresponding to the fragment shader

◆ ShaderProgram() [6/9]

CSCI441::ShaderProgram::ShaderProgram ( const char *  vertexShaderFilename,
const char *  tessellationControlShaderFilename,
const char *  tessellationEvaluationShaderFilename,
const char *  fragmentShaderFilename,
bool  isSeparable 
)
inline

Creates a Shader Program using a Vertex Shader, Tessellation Shader, and Fragment Shader.

Parameters
vertexShaderFilenamename of the file corresponding to the vertex shader
tessellationControlShaderFilenamename of the file corresponding to the tessellation control shader
tessellationEvaluationShaderFilenamename of the file corresponding to the tessellation evaluation shader
fragmentShaderFilenamename of the file corresponding to the fragment shader
isSeparableif program is separable

◆ ShaderProgram() [7/9]

CSCI441::ShaderProgram::ShaderProgram ( const char *  vertexShaderFilename,
const char *  geometryShaderFilename,
const char *  fragmentShaderFilename 
)
inline

Creates a Shader Program using a Vertex Shader, Geometry Shader, and Fragment Shader.

Parameters
vertexShaderFilenamename of the file corresponding to the vertex shader
geometryShaderFilenamename of the file corresponding to the geometry shader
fragmentShaderFilenamename of the file corresponding to the fragment shader

◆ ShaderProgram() [8/9]

CSCI441::ShaderProgram::ShaderProgram ( const char *  vertexShaderFilename,
const char *  geometryShaderFilename,
const char *  fragmentShaderFilename,
bool  isSeparable 
)
inline

Creates a Shader Program using a Vertex Shader, Geometry Shader, and Fragment Shader.

Parameters
vertexShaderFilenamename of the file corresponding to the vertex shader
geometryShaderFilenamename of the file corresponding to the geometry shader
fragmentShaderFilenamename of the file corresponding to the fragment shader
isSeparableif program is separable

◆ ShaderProgram() [9/9]

CSCI441::ShaderProgram::ShaderProgram ( const char **  shaderFilenames,
bool  vertexPresent,
bool  tessellationPresent,
bool  geometryPresent,
bool  fragmentPresent,
bool  isSeparable 
)
inline

Creates a Shader Program using any combination of shaders. Intended to be used to create separable programs but can be used as an alternative to the above overloaded constructors to explicitly state which shaders are present.

Parameters
shaderFilenamesan array of filenames corresponding to all the shaders. size must be equal to the sum of true shaders present, with two for the tessellation shader
vertexPresentif vertex shader is present
tessellationPresentif tessellation shader is present
geometryPresentif geometry shader is present
fragmentPresentif fragment shader is present
isSeparableif program is separable

Member Function Documentation

◆ disableDebugMessages()

void CSCI441::ShaderProgram::disableDebugMessages ( )
inlinestatic

Disables debug messages from Shader Program functions.

Note
Debug messages are on by default.

◆ enableDebugMessages()

void CSCI441::ShaderProgram::enableDebugMessages ( )
inlinestatic

Enables debug messages from Shader Program functions.

Note
Debug messages are on by default.

◆ getAtomicCounterBufferBinding()

GLint CSCI441::ShaderProgram::getAtomicCounterBufferBinding ( const char *  atomicName) const
inlinefinalvirtual

Returns the binding point for the corresponding atomic counter buffer.

Parameters
atomicNamename of the atomic counter buffer to get size for
Returns
binding point of atomic counter buffer
Note
Prints an error message to standard error stream if the atomic counter is not found

◆ getAtomicCounterBufferOffset()

GLint CSCI441::ShaderProgram::getAtomicCounterBufferOffset ( const char *  atomicName) const
inlinefinalvirtual

Returns the offset into the buffer for the corresponding atomic counter buffer.

Parameters
atomicNamename of the atomic counter buffer to get size for
Returns
offset of atomic counter buffer
Note
Prints an error message to standard error stream if the atomic counter is not found

◆ getAtomicCounterBufferSize()

GLint CSCI441::ShaderProgram::getAtomicCounterBufferSize ( const char *  atomicName) const
inlinefinalvirtual

Returns the full buffer size for the corresponding atomic counter buffer.

Parameters
atomicNamename of the atomic counter buffer to get size for
Returns
size of atomic counter buffer
Note
Prints an error message to standard error stream if the atomic counter is not found

◆ getAttributeLocation()

GLint CSCI441::ShaderProgram::getAttributeLocation ( const char *  attributeName) const
inlinefinalvirtual

Returns the location of the given attribute in this shader program.

Parameters
attributeNamename of the attribute to get the location for
Returns
location of the given attribute in this shader program
Note
Prints an error message to standard error stream if the attribute is not found

◆ getImageBinding()

GLint CSCI441::ShaderProgram::getImageBinding ( const char *  imageName) const
inlinefinalvirtual

Returns the binding point for the corresponding image uniform.

Parameters
imageNamename of the image to get binding point for
Returns
binding point for image
Note
Prints an error message to standard error stream if the image is not found

◆ getNumAttributes()

GLuint CSCI441::ShaderProgram::getNumAttributes ( ) const
inlinefinalvirtual

Returns the number of active attributes in this shader program.

Returns
number of active attributes in this shader program

◆ getNumUniformBlocks()

GLuint CSCI441::ShaderProgram::getNumUniformBlocks ( ) const
inlinefinalvirtual

Returns the number of active uniform blocks in this shader program.

Returns
number of active uniform blocks in this shader program

◆ getNumUniforms()

GLuint CSCI441::ShaderProgram::getNumUniforms ( ) const
inlinefinalvirtual

Returns the number of active uniforms in this shader program.

Returns
number of active uniforms in this shader program

◆ getProgramStages()

GLbitfield CSCI441::ShaderProgram::getProgramStages ( ) const
inlinefinalvirtual

returns a single value corresponding to which shader stages are present in this shader program

Returns
bitfield of shader stages

◆ getShaderProgramHandle()

GLuint CSCI441::ShaderProgram::getShaderProgramHandle ( ) const
inlinefinalvirtual

Returns the handle for this shader program.

Returns
handle for this shader program

◆ getShaderStorageBlockBinding()

GLint CSCI441::ShaderProgram::getShaderStorageBlockBinding ( const char *  ssboName) const
inlinefinalvirtual

Returns the binding point for the corresponding shader storage block.

Parameters
ssboNamename of the shader storage block to get binding point for
Returns
binding point for shader storage block
Note
Prints an error message to standard error stream if the shader storage block is not found

◆ getSubroutineIndex()

GLuint CSCI441::ShaderProgram::getSubroutineIndex ( GLenum  shaderStage,
const char *  subroutineName 
) const
inlinefinalvirtual

Returns the index of the given subroutine for a shader stage in this shader program.

Parameters
shaderStagestage of the shader program to get the subroutine for. Allowable values: GL_VERTEX_SHADER, GL_TESS_CONTROL_SHADER, GL_TESS_EVALUATION_SHADER, GL_GEOMETRY_SHADER, GL_FRAGMENT_SHADER
subroutineNamename of the subroutine to get the location for
Returns
index of the given subroutine for the shader stage in this shader program
Note
Prints an error message to standard error stream if the subroutine is not found

◆ getUniformBlockBuffer()

GLubyte * CSCI441::ShaderProgram::getUniformBlockBuffer ( const char *  uniformBlockName) const
inlinefinalvirtual

Returns an allocated buffer for the given uniform block in this shader program.

Parameters
uniformBlockNamename of the uniform block to allocate a buffer for
Returns
allocated buffer for the given uniform block in this shader program
Note
Prints an error message to standard error stream if the uniform block is not found

◆ getUniformBlockIndex()

GLint CSCI441::ShaderProgram::getUniformBlockIndex ( const char *  uniformBlockName) const
inlinefinalvirtual

Returns the index of the given uniform block in this shader program.

Parameters
uniformBlockNamename of the uniform block to get the index for
Returns
index of the given uniform block in this shader program
Note
Prints an error message to standard error stream if the uniform block is not found

◆ getUniformBlockOffsets() [1/4]

GLint * CSCI441::ShaderProgram::getUniformBlockOffsets ( const char *  uniformBlockName) const
inlinefinalvirtual

Returns an array of offsets into the buffer for the given uniform block in this shader program.

Parameters
uniformBlockNamename of the uniform block to return offsets for
Returns
array of offsets for the given uniform block in this shader program
Note
Prints an error message to standard error stream if the uniform block is not found

◆ getUniformBlockOffsets() [2/4]

GLint * CSCI441::ShaderProgram::getUniformBlockOffsets ( const char *  uniformBlockName,
const char *  names[] 
) const
inlinefinalvirtual

Returns an array of offsets into the buffer for the given uniform block and names in this shader program.

Parameters
uniformBlockNamename of the uniform block to return offsets for
namesnames of the uniform block components to get offsets for
Returns
array of offsets for the given uniform block in this shader program
Note
Prints an error message to standard error stream if the uniform block is not found

◆ getUniformBlockOffsets() [3/4]

GLint * CSCI441::ShaderProgram::getUniformBlockOffsets ( GLint  uniformBlockIndex) const
inlinefinalvirtual

Returns an array of offsets into the buffer for the given uniform block in this shader program.

Parameters
uniformBlockIndexindex uniform block to return offsets for
Returns
array of offsets for the given uniform block in this shader program
Note
Prints an error message to standard error stream if the uniform block is not found

◆ getUniformBlockOffsets() [4/4]

GLint * CSCI441::ShaderProgram::getUniformBlockOffsets ( GLint  uniformBlockIndex,
const char *  names[] 
) const
inlinefinalvirtual

Returns an array of offsets into the buffer for the given uniform block and names in this shader program.

Parameters
uniformBlockIndexindex uniform block to return offsets for
namesnames of the uniform block components to get offsets for
Returns
array of offsets for the given uniform block in this shader program
Note
Prints an error message to standard error stream if the uniform block is not found

◆ getUniformBlockSize()

GLint CSCI441::ShaderProgram::getUniformBlockSize ( const char *  uniformBlockName) const
inlinefinalvirtual

Returns the size of the given uniform block in this shader program.

Parameters
uniformBlockName- name of the uniform block to get the size for
Returns
size of the given uniform block in this shader program
Note
Prints an error message to standard error stream if the uniform block is not found

◆ getUniformLocation()

GLint CSCI441::ShaderProgram::getUniformLocation ( const char *  uniformName) const
inlinefinalvirtual

Returns the location of the given uniform in this shader program.

Parameters
uniformNamename of the uniform to get the location for
Returns
location of the given uniform in this shader program
Note
Prints an error message to standard error stream if the uniform is not found

◆ loadShaderProgramFromBinaryFile()

CSCI441::ShaderProgram * CSCI441::ShaderProgram::loadShaderProgramFromBinaryFile ( const char *  BINARY_FILE_NAME,
GLenum  format 
)
inlinestatic

loads precompiled shader program binary from external file

Parameters
BINARY_FILE_NAMEfilename to read shader program binary from
formatformat of binary data
Returns
true if read succeeded, false otherwise

◆ mRegisterShaderProgram()

bool CSCI441::ShaderProgram::mRegisterShaderProgram ( const char *  vertexShaderFilename,
const char *  tessellationControlShaderFilename,
const char *  tessellationEvaluationShaderFilename,
const char *  geometryShaderFilename,
const char *  fragmentShaderFilename,
bool  isSeparable 
)
inlinefinalprotectedvirtual

registers a shader program with the GPU

Parameters
vertexShaderFilenamevertex shader filename to load from text file
tessellationControlShaderFilenametessellation control shader filename to load from text file
tessellationEvaluationShaderFilenametessellation evaluation shader filename to load from text file
geometryShaderFilenamegeometry shader filename to load from text file
fragmentShaderFilenamefragment shader filename to load from text file
isSeparableif shader program is separable
Returns
true if shader program handle could be created, false otherwise

◆ setProgramUniform() [1/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLfloat  v0 
) const
inlinefinalvirtual

sets the program uniform consisting of one float

Parameters
uniformNamename of the uniform as a string
v0value to set

◆ setProgramUniform() [2/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLfloat  v0,
GLfloat  v1 
) const
inlinefinalvirtual

sets the program uniform consisting of two floats

Parameters
uniformNamename of the uniform as a string
v0value to set
v1value to set

◆ setProgramUniform() [3/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLfloat  v0,
GLfloat  v1,
GLfloat  v2 
) const
inlinefinalvirtual

sets the program uniform consisting of three floats

Parameters
uniformNamename of the uniform as a string
v0value to set
v1value to set
v2value to set

◆ setProgramUniform() [4/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLfloat  v0,
GLfloat  v1,
GLfloat  v2,
GLfloat  v3 
) const
inlinefinalvirtual

sets the program uniform consisting of four floats

Parameters
uniformNamename of the uniform as a string
v0value to set
v1value to set
v2value to set
v3value to set

◆ setProgramUniform() [5/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLint  v0 
) const
inlinefinalvirtual

sets the program uniform consisting of one integer

Parameters
uniformNamename of the uniform as a string
v0value to set

◆ setProgramUniform() [6/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLint  v0,
GLint  v1 
) const
inlinefinalvirtual

sets the program uniform consisting of two integers

Parameters
uniformNamename of the uniform as a string
v0value to set
v1value to set

◆ setProgramUniform() [7/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLint  v0,
GLint  v1,
GLint  v2 
) const
inlinefinalvirtual

sets the program uniform consisting of three integers

Parameters
uniformNamename of the uniform as a string
v0value to set
v1value to set
v2value to set

◆ setProgramUniform() [8/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLint  v0,
GLint  v1,
GLint  v2,
GLint  v3 
) const
inlinefinalvirtual

sets the program uniform consisting of four integers

Parameters
uniformNamename of the uniform as a string
v0value to set
v1value to set
v2value to set
v3value to set

◆ setProgramUniform() [9/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::ivec2  value 
) const
inlinefinalvirtual

sets the program uniform consisting of two integers

Parameters
uniformNamename of the uniform as a string
valuevalue to set

◆ setProgramUniform() [10/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::ivec3  value 
) const
inlinefinalvirtual

sets the program uniform consisting of three integers

Parameters
uniformNamename of the uniform as a string
valuevalue to set

◆ setProgramUniform() [11/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::ivec4  value 
) const
inlinefinalvirtual

sets the program uniform consisting of four integers

Parameters
uniformNamename of the uniform as a string
valuevalue to set

◆ setProgramUniform() [12/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::mat2  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 2x2 matrix

Parameters
uniformNamename of the uniform as a string
mtxvalue to set

◆ setProgramUniform() [13/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::mat2x3  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 2x3 matrix

Parameters
uniformNamename of the uniform as a string
mtxvalue to set

◆ setProgramUniform() [14/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::mat2x4  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 2x4 matrix

Parameters
uniformNamename of the uniform as a string
mtxvalue to set

◆ setProgramUniform() [15/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::mat3  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 3x3 matrix

Parameters
uniformNamename of the uniform as a string
mtxvalue to set

◆ setProgramUniform() [16/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::mat3x2  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 3x2 matrix

Parameters
uniformNamename of the uniform as a string
mtxvalue to set

◆ setProgramUniform() [17/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::mat3x4  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 3x4 matrix

Parameters
uniformNamename of the uniform as a string
mtxvalue to set

◆ setProgramUniform() [18/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::mat4  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 4x4 matrix

Parameters
uniformNamename of the uniform as a string
mtxvalue to set

◆ setProgramUniform() [19/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::mat4x2  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 4x2 matrix

Parameters
uniformNamename of the uniform as a string
mtxvalue to set

◆ setProgramUniform() [20/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::mat4x3  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 4x3 matrix

Parameters
uniformNamename of the uniform as a string
mtxvalue to set

◆ setProgramUniform() [21/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::uvec2  value 
) const
inlinefinalvirtual

sets the program uniform consisting of two unsigned integers

Parameters
uniformNamename of the uniform as a string
valuevalue to set

◆ setProgramUniform() [22/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::uvec3  value 
) const
inlinefinalvirtual

sets the program uniform consisting of three unsigned integers

Parameters
uniformNamename of the uniform as a string
valuevalue to set

◆ setProgramUniform() [23/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::uvec4  value 
) const
inlinefinalvirtual

sets the program uniform consisting of four unsigned integers

Parameters
uniformNamename of the uniform as a string
valuevalue to set

◆ setProgramUniform() [24/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::vec2  value 
) const
inlinefinalvirtual

sets the program uniform consisting of two floats

Parameters
uniformNamename of the uniform as a string
valuevalue to set

◆ setProgramUniform() [25/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::vec3  value 
) const
inlinefinalvirtual

sets the program uniform consisting of three floats

Parameters
uniformNamename of the uniform as a string
valuevalue to set

◆ setProgramUniform() [26/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
glm::vec4  value 
) const
inlinefinalvirtual

sets the program uniform consisting of four floats

Parameters
uniformNamename of the uniform as a string
valuevalue to set

◆ setProgramUniform() [27/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLuint  dim,
GLsizei  count,
const GLfloat *  value 
) const
inlinefinalvirtual

sets the program uniform consisting of floats

Parameters
uniformNamename of the uniform as a string
dimdimension (number of components) for each value
countnumber of values in array
valuearray of values (array size is equal to dim*count)

◆ setProgramUniform() [28/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLuint  dim,
GLsizei  count,
const GLint *  value 
) const
inlinefinalvirtual

sets the program uniform consisting of integers

Parameters
uniformNamename of the uniform as a string
dimdimension (number of components) for each value
countnumber of values in array
valuearray of values (array size is equal to dim*count)

◆ setProgramUniform() [29/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLuint  dim,
GLsizei  count,
const GLuint *  value 
) const
inlinefinalvirtual

sets the program uniform consisting of unsigned integers

Parameters
uniformNamename of the uniform as a string
dimdimension (number of components) for each value
countnumber of values in array
valuearray of values (array size is equal to dim*count)

◆ setProgramUniform() [30/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLuint  v0 
) const
inlinefinalvirtual

sets the program uniform consisting of one unsigned integer

Parameters
uniformNamename of the uniform as a string
v0value to set

◆ setProgramUniform() [31/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLuint  v0,
GLuint  v1 
) const
inlinefinalvirtual

sets the program uniform consisting of two unsigned integers

Parameters
uniformNamename of the uniform as a string
v0value to set
v1value to set

◆ setProgramUniform() [32/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLuint  v0,
GLuint  v1,
GLuint  v2 
) const
inlinefinalvirtual

sets the program uniform consisting of three unsigned integers

Parameters
uniformNamename of the uniform as a string
v0value to set
v1value to set
v2value to set

◆ setProgramUniform() [33/66]

void CSCI441::ShaderProgram::setProgramUniform ( const char *  uniformName,
GLuint  v0,
GLuint  v1,
GLuint  v2,
GLuint  v3 
) const
inlinefinalvirtual

sets the program uniform consisting of four unsigned integers

Parameters
uniformNamename of the uniform as a string
v0value to set
v1value to set
v2value to set
v3value to set

◆ setProgramUniform() [34/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLfloat  v0 
) const
inlinefinalvirtual

sets the program uniform consisting of one float

Parameters
uniformLocationlocation of the uniform
v0value to set

◆ setProgramUniform() [35/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLfloat  v0,
GLfloat  v1 
) const
inlinefinalvirtual

sets the program uniform consisting of two floats

Parameters
uniformLocationlocation of the uniform
v0value to set
v1value to set

◆ setProgramUniform() [36/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLfloat  v0,
GLfloat  v1,
GLfloat  v2 
) const
inlinefinalvirtual

sets the program uniform consisting of three floats

Parameters
uniformLocationlocation of the uniform
v0value to set
v1value to set
v2value to set

◆ setProgramUniform() [37/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLfloat  v0,
GLfloat  v1,
GLfloat  v2,
GLfloat  v3 
) const
inlinefinalvirtual

sets the program uniform consisting of four floats

Parameters
uniformLocationlocation of the uniform
v0value to set
v1value to set
v2value to set
v3value to set

◆ setProgramUniform() [38/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLint  v0 
) const
inlinefinalvirtual

sets the program uniform consisting of one integer

Parameters
uniformLocationlocation of the uniform
v0value to set

◆ setProgramUniform() [39/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLint  v0,
GLint  v1 
) const
inlinefinalvirtual

sets the program uniform consisting of two integers

Parameters
uniformLocationlocation of the uniform
v0value to set
v1value to set

◆ setProgramUniform() [40/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLint  v0,
GLint  v1,
GLint  v2 
) const
inlinefinalvirtual

sets the program uniform consisting of three integers

Parameters
uniformLocationlocation of the uniform
v0value to set
v1value to set
v2value to set

◆ setProgramUniform() [41/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLint  v0,
GLint  v1,
GLint  v2,
GLint  v3 
) const
inlinefinalvirtual

sets the program uniform consisting of four integers

Parameters
uniformLocationlocation of the uniform
v0value to set
v1value to set
v2value to set
v3value to set

◆ setProgramUniform() [42/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::ivec2  value 
) const
inlinefinalvirtual

sets the program uniform consisting of two integers

Parameters
uniformLocationlocation of the uniform
valuevalue to set

◆ setProgramUniform() [43/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::ivec3  value 
) const
inlinefinalvirtual

sets the program uniform consisting of three integers

Parameters
uniformLocationlocation of the uniform
valuevalue to set

◆ setProgramUniform() [44/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::ivec4  value 
) const
inlinefinalvirtual

sets the program uniform consisting of four integers

Parameters
uniformLocationlocation of the uniform
valuevalue to set

◆ setProgramUniform() [45/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::mat2  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 2x2 matrix

Parameters
uniformLocationlocation of the uniform
mtxvalue to set

◆ setProgramUniform() [46/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::mat2x3  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 2x3 matrix

Parameters
uniformLocationlocation of the uniform
mtxvalue to set

◆ setProgramUniform() [47/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::mat2x4  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 2x4 matrix

Parameters
uniformLocationlocation of the uniform
mtxvalue to set

◆ setProgramUniform() [48/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::mat3  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 3x3 matrix

Parameters
uniformLocationlocation of the uniform
mtxvalue to set

◆ setProgramUniform() [49/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::mat3x2  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 3x2 matrix

Parameters
uniformLocationlocation of the uniform
mtxvalue to set

◆ setProgramUniform() [50/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::mat3x4  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 3x4 matrix

Parameters
uniformLocationlocation of the uniform
mtxvalue to set

◆ setProgramUniform() [51/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::mat4  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 4x4 matrix

Parameters
uniformLocationlocation of the uniform
mtxvalue to set

◆ setProgramUniform() [52/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::mat4x2  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 4x2 matrix

Parameters
uniformLocationlocation of the uniform
mtxvalue to set

◆ setProgramUniform() [53/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::mat4x3  mtx 
) const
inlinefinalvirtual

sets the program uniform consisting of one 4x3 matrix

Parameters
uniformLocationlocation of the uniform
mtxvalue to set

◆ setProgramUniform() [54/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::uvec2  value 
) const
inlinefinalvirtual

sets the program uniform consisting of two unsigned integers

Parameters
uniformLocationlocation of the uniform
valuevalue to set

◆ setProgramUniform() [55/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::uvec3  value 
) const
inlinefinalvirtual

sets the program uniform consisting of three unsigned integers

Parameters
uniformLocationlocation of the uniform
valuevalue to set

◆ setProgramUniform() [56/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::uvec4  value 
) const
inlinefinalvirtual

sets the program uniform consisting of four unsigned integers

Parameters
uniformLocationlocation of the uniform
valuevalue to set

◆ setProgramUniform() [57/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::vec2  value 
) const
inlinefinalvirtual

sets the program uniform consisting of two floats

Parameters
uniformLocationlocation of the uniform
valuevalue to set

◆ setProgramUniform() [58/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::vec3  value 
) const
inlinefinalvirtual

sets the program uniform consisting of three floats

Parameters
uniformLocationlocation of the uniform
valuevalue to set

◆ setProgramUniform() [59/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
glm::vec4  value 
) const
inlinefinalvirtual

sets the program uniform consisting of four floats

Parameters
uniformLocationlocation of the uniform
valuevalue to set

◆ setProgramUniform() [60/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLuint  dim,
GLsizei  count,
const GLfloat *  value 
) const
inlinefinalvirtual

sets the program uniform consisting of floats

Parameters
uniformLocationlocation of the uniform
dimdimension (number of components) for each value
countnumber of values in array
valuearray of values (array size is equal to dim*count)

◆ setProgramUniform() [61/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLuint  dim,
GLsizei  count,
const GLint *  value 
) const
inlinefinalvirtual

sets the program uniform consisting of integers

Parameters
uniformLocationlocation of the uniform
dimdimension (number of components) for each value
countnumber of values in array
valuearray of values (array size is equal to dim*count)

◆ setProgramUniform() [62/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLuint  dim,
GLsizei  count,
const GLuint *  value 
) const
inlinefinalvirtual

sets the program uniform consisting of unsigned integers

Parameters
uniformLocationlocation of the uniform
dimdimension (number of components) for each value
countnumber of values in array
valuearray of values (array size is equal to dim*count)

◆ setProgramUniform() [63/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLuint  v0 
) const
inlinefinalvirtual

sets the program uniform consisting of one unsigned integer

Parameters
uniformLocationlocation of the uniform
v0value to set

◆ setProgramUniform() [64/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLuint  v0,
GLuint  v1 
) const
inlinefinalvirtual

sets the program uniform consisting of two unsigned integers

Parameters
uniformLocationlocation of the uniform
v0value to set
v1value to set

◆ setProgramUniform() [65/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLuint  v0,
GLuint  v1,
GLuint  v2 
) const
inlinefinalvirtual

sets the program uniform consisting of three unsigned integers

Parameters
uniformLocationlocation of the uniform
v0value to set
v1value to set
v2value to set

◆ setProgramUniform() [66/66]

void CSCI441::ShaderProgram::setProgramUniform ( GLint  uniformLocation,
GLuint  v0,
GLuint  v1,
GLuint  v2,
GLuint  v3 
) const
inlinefinalvirtual

sets the program uniform consisting of four unsigned integers

Parameters
uniformLocationlocation of the uniform
v0value to set
v1value to set
v2value to set
v3value to set

◆ setUniformBlockBinding()

void CSCI441::ShaderProgram::setUniformBlockBinding ( const char *  uniformBlockName,
GLuint  binding 
) const
inlinefinalvirtual

Set the binding point for the given uniform block in this shader program.

Parameters
uniformBlockNamename of the uniform block to bind
bindingpoint for this uniform block
Note
Prints an error message to standard error stream if the uniform block is not found

◆ writeShaderProgramBinaryToFile()

bool CSCI441::ShaderProgram::writeShaderProgramBinaryToFile ( const char *  BINARY_FILE_NAME) const
inlinefinalvirtual

writes precompiled shader program binary to external file

Parameters
BINARY_FILE_NAMEfilename to write shader program binary to
Returns
true if write succeeded, false otherwise

Member Data Documentation

◆ sDEBUG

bool CSCI441::ShaderProgram::sDEBUG = true
inlinestaticprotected

if DEBUG information should be printed or not

Note
defaults to true

The documentation for this class was generated from the following file: