Initial commit (2)

This commit is contained in:
BHBN
2020-03-06 21:23:51 +01:00
committed by GitHub
parent db75874e87
commit da59e80dbe
9 changed files with 1717 additions and 0 deletions

31
ShaderManager.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef vlmixer_shader
#define vlmixer_shader
#include <string>
#include <vector>
class Shader
{
public:
Shader();
void load(const std::string& vertex_rsc, const std::string& fragment_rsc);
void init(const std::string& vertex_code, const std::string& fragment_code);
void use();
template<typename T> void setUniform(const std::string& name, T val);
template<typename T> void setUniform(const std::string& name, T val1, T val2);
template<typename T> void setUniform(const std::string& name, T val1, T val2, T val3);
static void enduse();
private:
void checkCompileErr();
void checkLinkingErr();
void compile();
void link();
unsigned int vertex_id_, fragment_id_, id_;
std::string vertex_code_;
std::string fragment_code_;
};
#endif /* vlmixer_shader */