]> git.tdb.fi Git - libs/gl.git/blob - source/shader.h
Don't expose the shader type enum
[libs/gl.git] / source / shader.h
1 #ifndef MSP_GL_SHADER_H_
2 #define MSP_GL_SHADER_H_
3
4 #include <string>
5 #include "gl.h"
6
7 namespace Msp {
8 namespace GL {
9
10 class Shader
11 {
12 private:
13         unsigned id;
14         bool compiled;
15
16 protected:
17         Shader(GLenum t);
18         Shader(GLenum t, const std::string &);
19 private:
20         void init(GLenum);
21 public:
22         virtual ~Shader();
23
24         void source(unsigned count, const char **str, const int *len);
25         void source(const std::string &str);
26         void source(const char *str, int len);
27         void compile();
28         unsigned get_id() const { return id; }
29         bool is_compiled() const { return compiled; }
30         std::string get_info_log() const;
31 };
32
33
34 class VertexShader: public Shader
35 {
36 public:
37         VertexShader();
38         VertexShader(const std::string &);
39 };
40
41
42 class FragmentShader: public Shader
43 {
44 public:
45         FragmentShader();
46         FragmentShader(const std::string &);
47 };
48
49 } // namespace GL
50 } // namespace Msp
51
52 #endif