]> git.tdb.fi Git - libs/gl.git/blob - source/shader.h
Get rid of the typedefs for fundamental types
[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.h"
13
14 namespace Msp {
15 namespace GL {
16
17 enum ShaderType
18 {
19         FRAGMENT_SHADER = GL_FRAGMENT_SHADER,
20         VERTEX_SHADER   = GL_VERTEX_SHADER
21 };
22
23 class Shader
24 {
25 public:
26         Shader(ShaderType t);
27         Shader(ShaderType t, const std::string &);
28 private:
29         void init(ShaderType);
30 public:
31         ~Shader();
32
33         void source(unsigned count, const char **str, const int *len);
34         void source(const std::string &str);
35         void source(const char *str, int len);
36         void compile();
37         unsigned get_id() const { return id; }
38         bool get_compiled() const { return compiled; }
39         int get_param(GLenum param) const;
40         std::string get_info_log() const;
41 private:
42         unsigned id;
43         bool compiled;
44 };
45
46 } // namespace GL
47 } // namespace Msp
48
49 #endif