RenderEngine
Loading...
Searching...
No Matches
Shader Class Reference

Shader. More...

#include <Shader.hpp>

Inheritance diagram for Shader:
BasicMaterialShader MTLShader

Public Member Functions

 Shader ()
 Default constructor.
 
 Shader (std::string vertexshaderName, std::string fragmentshaderName)
 Constructor with shader source specification.
 
 Shader (std::string shaderName)
 Constructor with shader source specification.
 
virtual ~Shader ()
 Destructor.
 
GLuint LoadShaders (const char *vertex_file_path, const char *fragment_file_path)
 LoadShaders.
 
void initShaders (std::string vertexshaderName, std::string fragmentshaderName)
 initShaders
 
void updateMatrices (glm::mat4 MVP, glm::mat4 M, glm::mat4 V)
 updateMatrices
 
void updateMVP (glm::mat4 MVP)
 updateMVP
 
virtual void bind ()
 bind
 

Protected Attributes

GLuint programID
 
GLuint m_MVPID
 all shader should get information about the MVP matrix
 
GLuint m_VID
 all shader should get information about the view matrix
 
GLuint m_MID
 all shader should get information about the model matrix
 

Detailed Description

Shader.

Shader implementation. Contains all the required function calls like create shaders, compile shaders.

Constructor & Destructor Documentation

◆ Shader() [1/3]

Shader::Shader ( )
inline

Default constructor.

Does nothing at the moment

◆ Shader() [2/3]

Shader::Shader ( std::string  vertexshaderName,
std::string  fragmentshaderName 
)
inline

Constructor with shader source specification.

Creates the shaders from source, creates vertex and fragment shader at the same time. Uses different source file naming conventions

◆ Shader() [3/3]

Shader::Shader ( std::string  shaderName)
inline

Constructor with shader source specification.

Creates the shaders from source, creates vertex and fragment shader at the same time. Assumes that fragment and vertex shader have the same names

◆ ~Shader()

Shader::~Shader ( )
virtual

Destructor.

Virtual - write own destructor for each shader implementation

Member Function Documentation

◆ bind()

void Shader::bind ( )
virtual

bind

Shader binding, virtual

Reimplemented in BasicMaterialShader, and MTLShader.

◆ initShaders()

void Shader::initShaders ( std::string  vertexshaderName,
std::string  fragmentshaderName 
)

initShaders

init shaders

◆ LoadShaders()

GLuint Shader::LoadShaders ( const char *  vertex_file_path,
const char *  fragment_file_path 
)

LoadShaders.

Does the actual shader loading and compiling

◆ updateMatrices()

void Shader::updateMatrices ( glm::mat4  MVP,
glm::mat4  M,
glm::mat4  V 
)

updateMatrices

Updates the values for the model-view projection matrix and the model and view matrix separately

◆ updateMVP()

void Shader::updateMVP ( glm::mat4  MVP)

updateMVP

Updates the values for the model-view projection matrix

Member Data Documentation

◆ m_MID

GLuint Shader::m_MID
protected

all shader should get information about the model matrix

◆ m_MVPID

GLuint Shader::m_MVPID
protected

all shader should get information about the MVP matrix

◆ m_VID

GLuint Shader::m_VID
protected

all shader should get information about the view matrix

◆ programID

GLuint Shader::programID
protected

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