Vivid
Loading...
Searching...
No Matches
Vivid::Shader Class Reference

A class for the Shader. More...

#include <Shader.h>

Public Member Functions

 Shader (const String &filepathVertexShader, const String &filepathPixelShader)
 
void Bind () const
 
void Unbind () const
 
void SetUniform4f (const std::string &name, float f0, float f1, float f2, float f3)
 
void SetUniform4f (const std::string &name, const glm::vec4 &matrix)
 
void SetUniform3f (const std::string &name, float f0, float f1, float f2)
 
void SetUniform3f (const std::string &name, Maths::Vec3 &value)
 
void SetUniform1f (const std::string &name, float value)
 
void SetUniform1i (const std::string &name, int value)
 
void SetUniformMat4f (const std::string &name, const glm::mat4 &matrix)
 
String GetVertexShaderPath ()
 
String GetPixelShaderPath ()
 
unsigned int GetRendererID ()
 

Static Public Member Functions

static Ref< ShaderCreate (const std::string &filepathVertexShader, const std::string &filepathPixelShader)
 

Detailed Description

A class for the Shader.

Shader is a class that contains the vertex and pixel shaders. It can set uniforms and bind the shader. The shader can be created by the Create function.

Definition at line 24 of file Shader.h.

Constructor & Destructor Documentation

◆ Shader()

Vivid::Shader::Shader ( const String &  filepathVertexShader,
const String &  filepathPixelShader 
)

Definition at line 12 of file Shader.cpp.

◆ ~Shader()

Vivid::Shader::~Shader ( )

Definition at line 29 of file Shader.cpp.

Member Function Documentation

◆ Bind()

void Vivid::Shader::Bind ( ) const

Definition at line 34 of file Shader.cpp.

◆ Create()

Ref< Shader > Vivid::Shader::Create ( const std::string &  filepathVertexShader,
const std::string &  filepathPixelShader 
)
static

Definition at line 185 of file Shader.cpp.

◆ GetPixelShaderPath()

String Vivid::Shader::GetPixelShaderPath ( )
inline

Definition at line 51 of file Shader.h.

◆ GetRendererID()

unsigned int Vivid::Shader::GetRendererID ( )
inline

Definition at line 53 of file Shader.h.

◆ GetVertexShaderPath()

String Vivid::Shader::GetVertexShaderPath ( )
inline

Definition at line 50 of file Shader.h.

◆ SetUniform1f()

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

Definition at line 63 of file Shader.cpp.

◆ SetUniform1i()

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

Definition at line 58 of file Shader.cpp.

◆ SetUniform3f()

void Vivid::Shader::SetUniform3f ( const std::string &  name,
Maths::Vec3 value 
)

Definition at line 68 of file Shader.cpp.

◆ SetUniform4f() [1/2]

void Vivid::Shader::SetUniform4f ( const std::string &  name,
const glm::vec4 &  matrix 
)

Definition at line 78 of file Shader.cpp.

◆ SetUniform4f() [2/2]

void Vivid::Shader::SetUniform4f ( const std::string &  name,
float  f0,
float  f1,
float  f2,
float  f3 
)

Definition at line 73 of file Shader.cpp.

◆ SetUniformMat4f()

void Vivid::Shader::SetUniformMat4f ( const std::string &  name,
const glm::mat4 &  matrix 
)

Definition at line 83 of file Shader.cpp.

◆ Unbind()

void Vivid::Shader::Unbind ( ) const

Definition at line 39 of file Shader.cpp.


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