From 83c61036966c4c358a094cabe27c8de60082200d Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sat, 20 Nov 2021 00:29:28 +0500 Subject: Removed every reference to OpenGL except GalOgl.cpp --- src/Shader.hpp | 60 ---------------------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 src/Shader.hpp (limited to 'src/Shader.hpp') diff --git a/src/Shader.hpp b/src/Shader.hpp deleted file mode 100644 index 6b3220d..0000000 --- a/src/Shader.hpp +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once - -#include -#include -#include - -#include -#include -#include - -class Shader { - std::map uniforms; - GLuint program = 0; - - GLuint GetUniformLocation(const std::string &name); - -public: - Shader(const Shader &) = delete; - Shader(Shader &&other) = delete; - Shader &operator=(const Shader &) = delete; - Shader &operator=(Shader &&other) = delete; - - Shader(const std::string &vertSource, const std::string &fragSource, const std::vector &uniformsNames); - - ~Shader(); - - void Activate(); - - inline void SetUniform(const std::string& name, unsigned int val, unsigned int val2) { - glUniform2ui(GetUniformLocation(name), val, val2); - } - - inline void SetUniform(const std::string &name, int val) { - glUniform1i(GetUniformLocation(name), val); - } - - inline void SetUniform(const std::string& name, int val, int val2) { - glUniform2i(GetUniformLocation(name), val, val2); - } - - inline void SetUniform(const std::string &name, float val) { - glUniform1f(GetUniformLocation(name), val); - } - - inline void SetUniform(const std::string &name, glm::vec2 val) { - glUniform2f(GetUniformLocation(name), val.x, val.y); - } - - inline void SetUniform(const std::string &name, glm::vec3 val) { - glUniform3f(GetUniformLocation(name), val.x, val.y, val.z); - } - - inline void SetUniform(const std::string &name, glm::vec4 val) { - glUniform4f(GetUniformLocation(name), val.x, val.y, val.z, val.w); - } - - inline void SetUniform(const std::string &name, glm::mat4 val) { - glUniformMatrix4fv(GetUniformLocation(name), 1, GL_FALSE, glm::value_ptr(val)); - } -}; \ No newline at end of file -- cgit v1.2.3