]> git.localhorst.tv Git - gong.git/blob - src/graphics/Shader.hpp
code, assets, and other stuff stolen from blank
[gong.git] / src / graphics / Shader.hpp
1 #ifndef GONG_GRAPHICS_SHADER_HPP_
2 #define GONG_GRAPHICS_SHADER_HPP_
3
4 #include <iosfwd>
5 #include <GL/glew.h>
6
7
8 namespace gong {
9 namespace graphics {
10
11 class Shader {
12
13 public:
14         explicit Shader(GLenum type);
15         ~Shader();
16
17         Shader(Shader &&) noexcept;
18         Shader &operator =(Shader &&) noexcept;
19
20         Shader(const Shader &) = delete;
21         Shader &operator =(const Shader &) = delete;
22
23         void Source(const GLchar *src) noexcept;
24         void Compile() noexcept;
25         bool Compiled() const noexcept;
26         void Log(std::ostream &) const;
27
28         void AttachToProgram(GLuint id) const noexcept;
29
30 private:
31         GLuint handle;
32
33 };
34
35 }
36 }
37
38 #endif