2D_Game_Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Shader Class Reference

#include <shader.hpp>

Public Member Functions

 Shader (const char *vertex_shader_path, const char *fragment_shader_path)
 
 Shader ()=default
 
 ~Shader ()
 
void Load (const char *vertex_shader_path, const char *fragment_shader_path)
 
void Unload ()
 
void Reload ()
 
void Bind () const
 
void Unbind () const
 
unsigned int getID ()
 
void SetUniform4f (const std::string &name, float v0, float v1, float v2, float v3)
 
void SetUniform3f (const std::string &name, float v0, float v1, float v2)
 
void SetUniform2f (const std::string &name, float v0, float v1)
 
void SetUniform1f (const std::string &name, float v0)
 
void SetUniformMat4fv (const std::string &name, float *proj, unsigned int num_elem)
 
void SetUniform1iv (const std::string &name, int *v, unsigned int num_elem)
 
void SetUniform1i (const std::string &name, int v0)
 

Static Public Member Functions

static void SetSubroutineUniform (unsigned int uniform_index)
 
static unsigned int GetSubroutineIndex (const char *uniform_name, unsigned int shader_id)
 

Detailed Description

Definition at line 3 of file shader.hpp.

Constructor & Destructor Documentation

◆ Shader() [1/2]

Shader::Shader ( const char * vertex_shader_path,
const char * fragment_shader_path )

Definition at line 4 of file shader.cpp.

◆ Shader() [2/2]

Shader::Shader ( )
default

◆ ~Shader()

Shader::~Shader ( )

Definition at line 8 of file shader.cpp.

Member Function Documentation

◆ Bind()

void Shader::Bind ( ) const

Definition at line 68 of file shader.cpp.

◆ getID()

unsigned int Shader::getID ( )
inline

Definition at line 15 of file shader.hpp.

◆ GetSubroutineIndex()

unsigned int Shader::GetSubroutineIndex ( const char * uniform_name,
unsigned int shader_id )
static

Definition at line 154 of file shader.cpp.

◆ Load()

void Shader::Load ( const char * vertex_shader_path,
const char * fragment_shader_path )

Definition at line 16 of file shader.cpp.

◆ Reload()

void Shader::Reload ( )

Definition at line 63 of file shader.cpp.

◆ SetSubroutineUniform()

void Shader::SetSubroutineUniform ( unsigned int uniform_index)
static

Definition at line 163 of file shader.cpp.

◆ SetUniform1f()

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

Definition at line 132 of file shader.cpp.

◆ SetUniform1i()

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

Definition at line 140 of file shader.cpp.

◆ SetUniform1iv()

void Shader::SetUniform1iv ( const std::string & name,
int * v,
unsigned int num_elem )

Definition at line 128 of file shader.cpp.

◆ SetUniform2f()

void Shader::SetUniform2f ( const std::string & name,
float v0,
float v1 )

Definition at line 124 of file shader.cpp.

◆ SetUniform3f()

void Shader::SetUniform3f ( const std::string & name,
float v0,
float v1,
float v2 )

Definition at line 120 of file shader.cpp.

◆ SetUniform4f()

void Shader::SetUniform4f ( const std::string & name,
float v0,
float v1,
float v2,
float v3 )

Definition at line 116 of file shader.cpp.

◆ SetUniformMat4fv()

void Shader::SetUniformMat4fv ( const std::string & name,
float * proj,
unsigned int num_elem )

Definition at line 136 of file shader.cpp.

◆ Unbind()

void Shader::Unbind ( ) const

Definition at line 72 of file shader.cpp.

◆ Unload()

void Shader::Unload ( )

Definition at line 56 of file shader.cpp.


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