21 mutable std::unordered_map<std::string, int> VariablesLocations {};
22 mutable bool ShaderNotBindedErrorAlreadyShown {};
23 static int CurrentlyBoundShaderId;
32 constexpr static GLenum GetGLShaderType(
shader_type Type);
41 bool CompileShader(
const shader_props &Shader, GLuint &ShaderId);
49 bool CompileProgram(
const std::vector<GLuint> &Shaders);
57 bool Create(
const std::vector<shader_props> &Shaders);
65 int GetOrCacheLocation(
const std::string &Name)
const;
73 bool CheckIfShaderBinded()
const;
77 render_primitive::handle
GetHandle()
const override {
return Id; }
98 bool SetBool(
const std::string &Name,
bool Value)
const override;
99 bool SetFloat(
const std::string &Name,
float Value)
const override;
100 bool SetFloat2(
const std::string &Name,
const vec2 &Value)
const override;
101 bool SetFloat3(
const std::string &Name,
const vec3 &Value)
const override;
102 bool SetFloat4(
const std::string &Name,
const vec4 &Value)
const override;
103 bool SetInt(
const std::string &Name,
int Value)
const override;
104 bool SetInt2(
const std::string &Name,
const ivec2 &Value)
const override;
105 bool SetInt3(
const std::string &Name,
const ivec3 &Value)
const override;
106 bool SetInt4(
const std::string &Name,
const ivec4 &Value)
const override;
107 bool SetUInt(
const std::string &Name,
u32 Value)
const override;
108 bool SetUInt2(
const std::string &Name,
const uvec2 &Value)
const override;
109 bool SetUInt3(
const std::string &Name,
const uvec3 &Value)
const override;
110 bool SetUInt4(
const std::string &Name,
const uvec4 &Value)
const override;
111 bool SetMatr3(
const std::string &Name,
const matr3 &Value)
const override;
112 bool SetMatr4(
const std::string &Name,
const matr4 &Value)
const override;
114 bool SetBool(
int Location,
bool Value)
const override;
115 bool SetFloat(
int Location,
float Value)
const;
119 bool SetInt(
int Location,
int Value)
const;
136 void Bind()
const override;
144 void Unbind()
const override;
150 void Update(
const std::vector<shader_props> &Shaders)
override;
158 void Free()
override;
bool SetInt(const std::string &Name, int Value) const override
void Bind() const override
bool SetInt3(const std::string &Name, const ivec3 &Value) const override
bool SetInt4(const std::string &Name, const ivec4 &Value) const override
gl_shader_program(const std::vector< shader_props > &Shaders, const std::string &DebugName)
render_primitive::handle GetHandle() const override
bool SetBool(const std::string &Name, bool Value) const override
bool SetUInt2(const std::string &Name, const uvec2 &Value) const override
void Unbind() const override
bool SetFloat4(const std::string &Name, const vec4 &Value) const override
bool SetUInt3(const std::string &Name, const uvec3 &Value) const override
bool SetMatr4(const std::string &Name, const matr4 &Value) const override
void Update(const std::vector< shader_props > &Shaders) override
bool SetMatr3(const std::string &Name, const matr3 &Value) const override
bool SetFloat(const std::string &Name, float Value) const override
bool SetFloat3(const std::string &Name, const vec3 &Value) const override
bool SetFloat2(const std::string &Name, const vec2 &Value) const override
bool SetUInt4(const std::string &Name, const uvec4 &Value) const override
bool SetInt2(const std::string &Name, const ivec2 &Value) const override
bool SetUInt(const std::string &Name, u32 Value) const override
Shader program interface definition module.