26 void compile(
const char* vertexCode,
const char* fragmentCode);
34 void attach(GLuint theProgram,
const char* shaderCode, GLenum shaderType);
53 Shader(
const char* vertexLocation,
const char* fragmentLocation);
64 void loadFromString(
const char* vertexCode,
const char* fragmentCode);
73 void load(
const char* vertexLocation,
const char* fragmentLocation);
81 std::string
read(
const char* fileLocation);
GLuint m_uniformSpecularIntensity
A memory location for the specular intensity of the material.
Definition: Shader.hpp:199
GLuint & getProjectionLocation()
Get the memory location of the OpenGL Projection matrix in use.
Definition: Shader.hpp:90
GLuint m_uniformProjection
An OpenGL Projection matrix memory location.
Definition: Shader.hpp:191
std::string read(const char *fileLocation)
Read the contents of a shader file and output a std::string to be loaded as an OpenGL GLSL shader...
GLuint & getDiffuseIntensityLocation()
Get the memory location of the diffuse intensity for lighting.
Definition: Shader.hpp:135
void compile(const char *vertexCode, const char *fragmentCode)
Internal function that compiles and validates the GLSL shaders being loaded.
GLuint m_uniformDirection
A memory location for direction.
Definition: Shader.hpp:197
void load(const char *vertexLocation, const char *fragmentLocation)
Load OpenGL shader programs from file locations specified with C-style strings.
GLuint & getAmbientIntensityLocation()
Get the memory location of the ambient intensity for lighting.
Definition: Shader.hpp:117
GLuint m_uniformAmbientIntensity
A memory location for ambient intensity.
Definition: Shader.hpp:194
GLuint & getModelLocation()
Get the memory location of the OpenGL Model matrix in use.
Definition: Shader.hpp:99
GLuint & getViewLocation()
Get the memory location of the OpenGL View matrix in use.
Definition: Shader.hpp:108
GLuint m_uniformModel
An OpenGL Model matrix memory location.
Definition: Shader.hpp:192
GLuint m_uniformShininess
A memory location for the shininess of the material.
Definition: Shader.hpp:200
GLuint & getDirectionLocation()
Get the memory location of the direction of the lighting.
Definition: Shader.hpp:144
Shader()
Default constructor - in most cases you should be using the other constructor! Use this in the event ...
GLuint & getEyePositionLocation()
Get the memory location of the eye position of the lighting.
Definition: Shader.hpp:153
void use()
Call the necessary OpenGL code to use the shader. Needs to be called before drawing occurs in the gam...
Definition: Shader.hpp:171
GLuint & getAmbientColorLocation()
Get the memory location of the ambient color for lighting.
Definition: Shader.hpp:126
Class for supporting OpenGL GLSL shaders.
Definition: Shader.hpp:18
GLuint m_uniformView
An OpenGL View matrix memory location.
Definition: Shader.hpp:193
GLuint m_uniformDiffuseIntensity
A memory location for diffuse intensity.
Definition: Shader.hpp:196
GLuint m_uniformAmbientColor
A memory location for lighting ambient color.
Definition: Shader.hpp:195
GLuint & getShininessLocation()
Get the memory location of the shininess of the lighting.
Definition: Shader.hpp:171
GLuint & getSpecularIntensityLocation()
Get the memory location of the specular intensity of the lighting.
Definition: Shader.hpp:162
void attach(GLuint theProgram, const char *shaderCode, GLenum shaderType)
Internal function that performs the necessary actions to attach a shader to the OpenGL program...
void loadFromString(const char *vertexCode, const char *fragmentCode)
Load OpenGL shader programs from C-strings.
GLuint m_uniformEyePosition
A memory location for eye position (camera).
Definition: Shader.hpp:198
void clear()
Resets all states and data contained in the Shader class. Calls glDeleteProgram(...) because Shader class owns the shader program.
GLuint m_shaderID
The OpenGL GLSL shader ID.
Definition: Shader.hpp:190