Golias Engine
A C++ 20 'game engine' built with SDL3 with wide platform support.
Public Member Functions | Protected Attributes | List of all members
Shader Class Referenceabstract

Shader Abstract class. More...

#include <base_struct.h>

Inheritance diagram for Shader:
OpenglShader

Public Member Functions

 Shader ()=default
 
virtual ~Shader ()=default
 
virtual void activate () const =0
 
virtual void set_value (const std::string &name, float value)=0
 
virtual void set_value (const std::string &name, int value)=0
 
virtual void set_value (const std::string &name, Uint32 value)=0
 
virtual void set_value (const std::string &name, glm::mat4 value, Uint32 count=1)=0
 
virtual void set_value (const std::string &name, const int *value, Uint32 count=1)=0
 
virtual void set_value (const std::string &name, const float *value, Uint32 count=1)=0
 
virtual void set_value (const std::string &name, glm::vec2 value, Uint32 count=1)=0
 
virtual void set_value (const std::string &name, glm::vec3 value, Uint32 count=1)=0
 
virtual void set_value (const std::string &name, glm::vec4 value, Uint32 count=1)=0
 
virtual void set_value (const std::string &name, const glm::mat4 *values, Uint32 count=1)=0
 
virtual void destroy ()=0
 
virtual Uint32 get_id () const =0
 
virtual bool is_valid () const =0
 

Protected Attributes

Uint32 id = 0
 
std::unordered_map< std::string, Uint32 > _uniforms
 

Detailed Description

Shader Abstract class.

Version
0.0.2
Parameters
stringvertex The shader source
stringfragment The shader source

Constructor & Destructor Documentation

◆ Shader()

Shader::Shader ( )
default

◆ ~Shader()

virtual Shader::~Shader ( )
virtualdefault

Member Function Documentation

◆ activate()

virtual void Shader::activate ( ) const
pure virtual

Implemented in OpenglShader.

◆ destroy()

virtual void Shader::destroy ( )
pure virtual

Implemented in OpenglShader.

◆ get_id()

virtual Uint32 Shader::get_id ( ) const
pure virtual

Implemented in OpenglShader.

◆ is_valid()

virtual bool Shader::is_valid ( ) const
pure virtual

Implemented in OpenglShader.

◆ set_value() [1/10]

virtual void Shader::set_value ( const std::string &  name,
const float *  value,
Uint32  count = 1 
)
pure virtual

Implemented in OpenglShader.

◆ set_value() [2/10]

virtual void Shader::set_value ( const std::string &  name,
const glm::mat4 *  values,
Uint32  count = 1 
)
pure virtual

Implemented in OpenglShader.

◆ set_value() [3/10]

virtual void Shader::set_value ( const std::string &  name,
const int *  value,
Uint32  count = 1 
)
pure virtual

Implemented in OpenglShader.

◆ set_value() [4/10]

virtual void Shader::set_value ( const std::string &  name,
float  value 
)
pure virtual

Implemented in OpenglShader.

◆ set_value() [5/10]

virtual void Shader::set_value ( const std::string &  name,
glm::mat4  value,
Uint32  count = 1 
)
pure virtual

Implemented in OpenglShader.

◆ set_value() [6/10]

virtual void Shader::set_value ( const std::string &  name,
glm::vec2  value,
Uint32  count = 1 
)
pure virtual

Implemented in OpenglShader.

◆ set_value() [7/10]

virtual void Shader::set_value ( const std::string &  name,
glm::vec3  value,
Uint32  count = 1 
)
pure virtual

Implemented in OpenglShader.

◆ set_value() [8/10]

virtual void Shader::set_value ( const std::string &  name,
glm::vec4  value,
Uint32  count = 1 
)
pure virtual

Implemented in OpenglShader.

◆ set_value() [9/10]

virtual void Shader::set_value ( const std::string &  name,
int  value 
)
pure virtual

Implemented in OpenglShader.

◆ set_value() [10/10]

virtual void Shader::set_value ( const std::string &  name,
Uint32  value 
)
pure virtual

Implemented in OpenglShader.

Member Data Documentation

◆ _uniforms

std::unordered_map<std::string, Uint32> Shader::_uniforms
protected

◆ id

Uint32 Shader::id = 0
protected

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