GCP Assignment 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Shader Class Reference

Creates a Shader from an text file, this can then be used with OpenGL. More...

#include <Shader.h>

Collaboration diagram for Shader:
Collaboration graph

Public Member Functions

 Shader (std::string vertexShaderFileName, std::string fragmentShaderFileName)
 Creates a Shader Object using an shader file location and OpenGL. More...
 
 ~Shader ()
 Destructs the Shader Object deleting the Shader Object from memory. More...
 
GLuint getShaderProgram ()
 Returns the shader program. More...
 
GLint getModelMatrixLocation ()
 Returns the shader model matrix location. More...
 
GLint getViewMatrixLocation ()
 Returns the shader view matrix location. More...
 
GLint getShaderProjectionMatrixLocation ()
 Returns the shader projection matrix location. More...
 
GLint getTextureSamplerLocation ()
 Returns the texture sampler location. More...
 

Private Member Functions

bool CheckShaderCompiled (GLint shader)
 A function to test if the shader compiled successfully. More...
 
void initaliseShader (std::string shaderFileName, char shaderType)
 Initialise a shader. More...
 

Private Attributes

GLuint shaderProgram
 The Shader program of the Shader Object. More...
 
GLint shaderModelMatrixLocation
 The Uniform locations for the shader program. More...
 
GLint shaderViewMatrixLocation
 
GLint shaderProjectionMatrixLocation
 
GLint textureSamplerLocation
 

Detailed Description

Creates a Shader from an text file, this can then be used with OpenGL.

Constructor & Destructor Documentation

◆ Shader()

Shader::Shader ( std::string  vertexShaderFileName,
std::string  fragmentShaderFileName 
)

Creates a Shader Object using an shader file location and OpenGL.

Parameters
vertexShaderFileNameThe name of the vertex shader file.
fragmentShaderFileNameThe name of the fragment shader file.
Here is the call graph for this function:

◆ ~Shader()

Shader::~Shader ( )

Destructs the Shader Object deleting the Shader Object from memory.

Member Function Documentation

◆ CheckShaderCompiled()

bool Shader::CheckShaderCompiled ( GLint  shader)
private

A function to test if the shader compiled successfully.

Parameters
shaderThe shader to test.
Returns
If the shader compiled successfully.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getModelMatrixLocation()

GLint Shader::getModelMatrixLocation ( )

Returns the shader model matrix location.

Returns
The shader model matrix location.
Here is the caller graph for this function:

◆ getShaderProgram()

GLuint Shader::getShaderProgram ( )

Returns the shader program.

Returns
The shader program.
Here is the caller graph for this function:

◆ getShaderProjectionMatrixLocation()

GLint Shader::getShaderProjectionMatrixLocation ( )

Returns the shader projection matrix location.

Returns
The shader projection matrix location.
Here is the caller graph for this function:

◆ getTextureSamplerLocation()

GLint Shader::getTextureSamplerLocation ( )

Returns the texture sampler location.

Returns
The texture sampler location.
Here is the caller graph for this function:

◆ getViewMatrixLocation()

GLint Shader::getViewMatrixLocation ( )

Returns the shader view matrix location.

Returns
The shader view matrix location.
Here is the caller graph for this function:

◆ initaliseShader()

void Shader::initaliseShader ( std::string  shaderFileName,
char  shaderType 
)
private

Initialise a shader.

Parameters
shaderFileNameThe name of the shader file.
shaderTypeThe type of the shader.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ shaderModelMatrixLocation

GLint Shader::shaderModelMatrixLocation
private

The Uniform locations for the shader program.

◆ shaderProgram

GLuint Shader::shaderProgram
private

The Shader program of the Shader Object.

◆ shaderProjectionMatrixLocation

GLint Shader::shaderProjectionMatrixLocation
private

◆ shaderViewMatrixLocation

GLint Shader::shaderViewMatrixLocation
private

◆ textureSamplerLocation

GLint Shader::textureSamplerLocation
private

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