Shader.h 517 B

123456789101112131415161718192021222324252627
  1. #ifndef SHADER_H
  2. #define SHADER_H
  3. #include <GL/glew.h>
  4. class Shader final {
  5. public:
  6. Shader();
  7. ~Shader();
  8. Shader(const Shader& other) = delete;
  9. Shader(Shader&& other) = delete;
  10. Shader& operator=(const Shader& other) = delete;
  11. Shader& operator=(Shader&& other) = delete;
  12. bool hasError() const;
  13. void use() const;
  14. private:
  15. void clean();
  16. bool compile(GLuint& shader, const GLchar* code, GLenum shaderType);
  17. GLuint vShader;
  18. GLuint fShader;
  19. GLuint program;
  20. };
  21. #endif