6#ifndef MATF_RG_PROJECT_SHADER_HPP
7#define MATF_RG_PROJECT_SHADER_HPP
52 void set_bool(
const std::string &
name,
bool value)
const;
59 void set_int(
const std::string &
name,
int value)
const;
73 void set_vec2(
const std::string &
name,
const glm::vec2 &value)
const;
80 void set_vec3(
const std::string &
name,
const glm::vec3 &value)
const;
87 void set_vec4(
const std::string &
name,
const glm::vec4 &value)
const;
94 void set_mat2(
const std::string &
name,
const glm::mat2 &mat)
const;
101 void set_mat3(
const std::string &
name,
const glm::mat3 &mat)
const;
108 void set_mat4(
const std::string &
name,
const glm::mat4 &mat)
const;
114 const std::string &
name()
const;
Defines utility functions, macros, algorithms, and data structures.
Compiles GLSL shaders from a single source file. Vertex, Fragment and Geometry shaders are seperated ...
Definition ShaderCompiler.hpp:48
Represents a linked shader program object within the OpenGL context.
Definition Shader.hpp:32
std::string m_name
The name of the shader program.
Definition Shader.hpp:152
void set_vec3(const std::string &name, const glm::vec3 &value) const
Sets a 3D vector uniform value.
Definition Shader.cpp:39
void set_float(const std::string &name, float value) const
Sets a float uniform value.
Definition Shader.cpp:29
std::string m_source
Definition Shader.hpp:153
std::filesystem::path m_source_path
Definition Shader.hpp:154
const std::filesystem::path & source_path() const
Returns the path to the source file from which the shader program was compiled.
unsigned id() const
Returns the OpenGL ID of the shader program.
Definition Shader.cpp:15
void set_mat3(const std::string &name, const glm::mat3 &mat) const
Sets a 3x3 matrix uniform value.
Definition Shader.cpp:54
void set_mat4(const std::string &name, const glm::mat4 &mat) const
Sets a 4x4 matrix uniform value.
Definition Shader.cpp:59
unsigned m_shaderId
The OpenGL ID of the shader program.
Definition Shader.hpp:147
void set_vec2(const std::string &name, const glm::vec2 &value) const
Sets a 2D vector uniform value.
Definition Shader.cpp:34
void set_bool(const std::string &name, bool value) const
Sets a boolean uniform value.
Definition Shader.cpp:19
const std::string & name() const
Returns the name of the shader program by which it can be referenced using the engine::resources::Res...
void destroy() const
Destroys the shader program in the OpenGL context.
Definition Shader.cpp:11
void set_int(const std::string &name, int value) const
Sets an integer uniform value.
Definition Shader.cpp:24
void use() const
Binds the shader program.
Definition Shader.cpp:7
void set_mat2(const std::string &name, const glm::mat2 &mat) const
Sets a 2x2 matrix uniform value.
Definition Shader.cpp:49
void set_vec4(const std::string &name, const glm::vec4 &value) const
Sets a 4D vector uniform value.
Definition Shader.cpp:44
const std::string & source() const
Returns the source code of the shader program.
Definition GraphicsController.hpp:14
ShaderType
The type of the shader.
Definition Shader.hpp:19
std::string_view to_string(ShaderType type)
Converts a ShaderType to a string.
Definition ShaderCompiler.cpp:109
std::string ShaderName
Definition Shader.hpp:13
Represents a vertex in the mesh.
Definition Mesh.hpp:18