]> git.tdb.fi Git - libs/gl.git/blob - source/shader.h
Drop Id tags and copyright notices from files
[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 enum ShaderType
11 {
12         FRAGMENT_SHADER = GL_FRAGMENT_SHADER_ARB,
13         VERTEX_SHADER   = GL_VERTEX_SHADER_ARB
14 };
15
16 class Shader
17 {
18 private:
19         unsigned id;
20         bool compiled;
21
22 public:
23         Shader(ShaderType t);
24         Shader(ShaderType t, const std::string &);
25 private:
26         void init(ShaderType);
27 public:
28         ~Shader();
29
30         void source(unsigned count, const char **str, const int *len);
31         void source(const std::string &str);
32         void source(const char *str, int len);
33         void compile();
34         unsigned get_id() const { return id; }
35         bool is_compiled() const { return compiled; }
36         std::string get_info_log() const;
37 };
38
39 } // namespace GL
40 } // namespace Msp
41
42 #endif