Falcon
Public Member Functions | Public Attributes | List of all members
Shader Class Reference

#include <Shader.h>

Public Member Functions

 Shader (const GLchar *vertexPath, const GLchar *fragmentPath)
 
bool LinkShaders ()
 
void UseShader ()
 
void SetBool (const std::string &name, bool value) const
 
void SetInt (const std::string &name, int value) const
 
void SetFloat (const std::string &name, float value) const
 
void SetVec2 (const std::string &name, const glm::vec2 &value) const
 
void SetVec2 (const std::string &name, float x, float y) const
 
void SetVec3 (const std::string &name, const glm::vec3 &value) const
 
void SetVec3 (const std::string &name, float x, float y, float z) const
 
void SetVec4 (const std::string &name, const glm::vec4 &value) const
 
void SetVec4 (const std::string &name, float x, float y, float z, float w) const
 
void SetMat2 (const std::string &name, const glm::mat2 &mat) const
 
void SetMat3 (const std::string &name, const glm::mat3 &mat) const
 
void SetMat4 (const std::string &name, const glm::mat4 &mat) const
 
GLint GetUniform (const GLchar *name)
 

Public Attributes

unsigned int m_programID = 0
 
SimpleShader m_vertexShader
 
SimpleShader m_fragmentShader
 

Detailed Description

Shader Class to compile and store Simple Shaders using OpenGL commands.

Constructor & Destructor Documentation

◆ Shader()

Shader::Shader ( const GLchar *  vertexPath,
const GLchar *  fragmentPath 
)

Member Function Documentation

◆ GetUniform()

GLint Shader::GetUniform ( const GLchar *  name)

◆ LinkShaders()

bool Shader::LinkShaders ( )

Links the shaders with current program.

◆ SetBool()

void Shader::SetBool ( const std::string &  name,
bool  value 
) const

◆ SetFloat()

void Shader::SetFloat ( const std::string &  name,
float  value 
) const

◆ SetInt()

void Shader::SetInt ( const std::string &  name,
int  value 
) const

◆ SetMat2()

void Shader::SetMat2 ( const std::string &  name,
const glm::mat2 &  mat 
) const

◆ SetMat3()

void Shader::SetMat3 ( const std::string &  name,
const glm::mat3 &  mat 
) const

◆ SetMat4()

void Shader::SetMat4 ( const std::string &  name,
const glm::mat4 &  mat 
) const

◆ SetVec2() [1/2]

void Shader::SetVec2 ( const std::string &  name,
const glm::vec2 &  value 
) const

◆ SetVec2() [2/2]

void Shader::SetVec2 ( const std::string &  name,
float  x,
float  y 
) const

◆ SetVec3() [1/2]

void Shader::SetVec3 ( const std::string &  name,
const glm::vec3 &  value 
) const

◆ SetVec3() [2/2]

void Shader::SetVec3 ( const std::string &  name,
float  x,
float  y,
float  z 
) const

◆ SetVec4() [1/2]

void Shader::SetVec4 ( const std::string &  name,
const glm::vec4 &  value 
) const

◆ SetVec4() [2/2]

void Shader::SetVec4 ( const std::string &  name,
float  x,
float  y,
float  z,
float  w 
) const

◆ UseShader()

void Shader::UseShader ( )

Member Data Documentation

◆ m_fragmentShader

SimpleShader Shader::m_fragmentShader

◆ m_programID

unsigned int Shader::m_programID = 0

◆ m_vertexShader

SimpleShader Shader::m_vertexShader

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