Shader abstractions

This commit is contained in:
Ben
2019-01-13 16:27:45 +00:00
parent 459f897ef7
commit 34cb0fb1c6
4 changed files with 170 additions and 74 deletions

View File

@@ -0,0 +1,38 @@
#ifndef _SHADER_H_
#define _SHADER_H_
#include <GL/glew.h>
#include <string>
class Shader {
public:
Shader();
Shader& use();
Shader& link();
Shader& attatch();
Shader& load(GLenum type, std::string sourceLoc);
Shader& load(std::string sourceLoc);
GLuint getProgram();
GLuint getVertex();
GLuint getFragment();
virtual ~Shader();
private:
Shader(Shader const &) = delete;
Shader & operator=(Shader const &) = delete;
GLuint m_program;
GLuint m_vert;
GLuint m_frag;
std::string m_vertSource;
std::string m_fragSource;
std::string m_vertLoc;
std::string m_fragLoc;
GLint m_status;
};
#endif