]> git.tdb.fi Git - libs/gl.git/blob - source/shader.h
Add mult_matrix functions
[libs/gl.git] / source / shader.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_SHADER_H_
9 #define MSP_GL_SHADER_H_
10
11 #include <string>
12 #include <GL/gl.h>
13 #include "types.h"
14
15 namespace Msp {
16 namespace GL {
17
18 enum ShaderType
19 {
20         FRAGMENT_SHADER = GL_FRAGMENT_SHADER,
21         VERTEX_SHADER   = GL_VERTEX_SHADER
22 };
23
24 class Shader
25 {
26 public:
27         Shader(ShaderType t);
28         Shader(ShaderType t, const std::string &);
29         ~Shader();
30
31         void source(sizei count, const char **str, const int *len);
32         void source(const std::string &str);
33         void source(const char *str, int len);
34         bool compile();
35         uint get_id() const { return id; }
36         bool get_compiled() const { return compiled; }
37         int get_param(GLenum param) const;
38         std::string get_info_log() const;
39 private:
40         uint id;
41         bool compiled;
42 };
43
44 } // namespace GL
45 } // namespace Msp
46
47 #endif