Jamie Slowgrove - PGG Assignment 2
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Shader Class Reference

Creates a Shader for use with OpenGL. 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)
 
 ~Shader ()
 
GLuint getShaderProgram ()
 
GLint getModelMatrixLocation ()
 
GLint getViewMatrixLocation ()
 
GLint getShaderProjectionMatrixLocation ()
 
GLint getTextureSamplerLocation ()
 

Private Member Functions

bool CheckShaderCompiled (GLint shader)
 
void initaliseShader (std::string shaderFileName, char shaderType)
 

Private Attributes

GLuint shaderProgram
 
GLint shaderModelMatrixLocation
 
GLint shaderViewMatrixLocation
 
GLint shaderProjectionMatrixLocation
 
GLint textureSamplerLocation
 

Detailed Description

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

Author
Jamie Slowgrove

Constructor & Destructor Documentation

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

Constructs a Shader Object. 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 ( )

Destructs a Shader Object. Destructs the Shader Object deleting the Shader Object from memory.

Member Function Documentation

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 caller graph for this function:

GLint Shader::getModelMatrixLocation ( )

Getter # Returns the shader model matrix location.

Returns
The shader model matrix location.
GLuint Shader::getShaderProgram ( )

Getter # Returns the shader program.

Returns
The shader program.

Here is the caller graph for this function:

GLint Shader::getShaderProjectionMatrixLocation ( )

Getter # Returns the shader projection matrix location.

Returns
The shader projection matrix location.
GLint Shader::getTextureSamplerLocation ( )

Getter # Returns the texture sampler location.

Returns
The texture sampler location.

Here is the caller graph for this function:

GLint Shader::getViewMatrixLocation ( )

Getter # Returns the shader view matrix location.

Returns
The shader view matrix location.
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

GLint Shader::shaderModelMatrixLocation
private

The Uniform locations for the shader program

GLuint Shader::shaderProgram
private

The Shader program of the Shader Object

GLint Shader::shaderProjectionMatrixLocation
private
GLint Shader::shaderViewMatrixLocation
private
GLint Shader::textureSamplerLocation
private

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