Fireworks Engine  v2.0
Lightweight Sandbox Game Engine using OpenGL for additional Customisation and Quick Prototyping
fireworks::graphics::Shader Class Reference

The class responsible for creating amazing shaders. More...

#include <Shader.h>

Public Member Functions

 Shader (const char *vertexPath, const char *fragmentPath)
 Creates the shader by taking in the vertex and fragment shader files. More...
 
 ~Shader ()
 
void setUniform1f (const GLchar *name, float value)
 
void setUniform1fv (const GLchar *name, float *value, GLsizei count)
 
void setUniform1i (const GLchar *name, int value)
 
void setUniform1iv (const GLchar *name, int *value, GLsizei count)
 
void setUniform2f (const GLchar *name, const glm::vec2 &vector)
 
void setUniform3f (const GLchar *name, const glm::vec3 &vector)
 
void setUniform4f (const GLchar *name, const glm::vec4 &vector)
 
void setUniformMat4 (const GLchar *name, const glm::mat4 &matrix)
 
void enable ()
 Enables the shader. More...
 
void disable ()
 Disables the shader. More...
 
GLint getShaderProgram () const
 Gets the shaders Program. More...
 

Public Attributes

GLuint m_ShaderID
 The ID of the shader. More...
 
const char * m_VertPath
 Path to the vertex shader file. More...
 
const char * m_FragPath
 Path to the fragment shader file. More...
 

Detailed Description

The class responsible for creating amazing shaders.

Constructor & Destructor Documentation

◆ Shader()

fireworks::graphics::Shader::Shader ( const char *  vertexPath,
const char *  fragmentPath 
)

Creates the shader by taking in the vertex and fragment shader files.

Parameters
vertexPathThe path to the vertex shader file
fragmentPathThe path to the fragment shader file

◆ ~Shader()

fireworks::graphics::Shader::~Shader ( )

Member Function Documentation

◆ disable()

void fireworks::graphics::Shader::disable ( )

Disables the shader.

◆ enable()

void fireworks::graphics::Shader::enable ( )

Enables the shader.

◆ getShaderProgram()

GLint fireworks::graphics::Shader::getShaderProgram ( ) const
inline

Gets the shaders Program.

◆ setUniform1f()

void fireworks::graphics::Shader::setUniform1f ( const GLchar *  name,
float  value 
)

◆ setUniform1fv()

void fireworks::graphics::Shader::setUniform1fv ( const GLchar *  name,
float *  value,
GLsizei  count 
)

◆ setUniform1i()

void fireworks::graphics::Shader::setUniform1i ( const GLchar *  name,
int  value 
)

◆ setUniform1iv()

void fireworks::graphics::Shader::setUniform1iv ( const GLchar *  name,
int *  value,
GLsizei  count 
)

◆ setUniform2f()

void fireworks::graphics::Shader::setUniform2f ( const GLchar *  name,
const glm::vec2 &  vector 
)

◆ setUniform3f()

void fireworks::graphics::Shader::setUniform3f ( const GLchar *  name,
const glm::vec3 &  vector 
)

◆ setUniform4f()

void fireworks::graphics::Shader::setUniform4f ( const GLchar *  name,
const glm::vec4 &  vector 
)

◆ setUniformMat4()

void fireworks::graphics::Shader::setUniformMat4 ( const GLchar *  name,
const glm::mat4 &  matrix 
)

Member Data Documentation

◆ m_FragPath

const char* fireworks::graphics::Shader::m_FragPath

Path to the fragment shader file.

◆ m_ShaderID

GLuint fireworks::graphics::Shader::m_ShaderID

The ID of the shader.

◆ m_VertPath

const char* fireworks::graphics::Shader::m_VertPath

Path to the vertex shader file.


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