]> git.tdb.fi Git - libs/gl.git/blob - source/program.h
Make ~Program virtual
[libs/gl.git] / source / program.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_PROGRAM_H_
9 #define MSP_GL_PROGRAM_H_
10
11 #include <list>
12 #include <string>
13 #include <GL/gl.h>
14 #include "shader.h"
15 #include "types.h"
16
17 namespace Msp {
18 namespace GL {
19
20 class Shader;
21
22 class Program
23 {
24 public:
25         Program();
26         virtual ~Program();
27
28         void attach_shader(Shader &shader);
29         void detach_shader(Shader &shader);
30         bool link();
31         int get_param(GLenum param) const;
32         std::string get_info_log() const;
33         void bind();
34
35         static void unbind();
36 private:
37         uint id;
38         std::list<Shader *> shaders;
39         bool linked;
40
41         static Program *cur_prog;
42 };
43
44 } // namespace GL
45 } // namespace Msp
46
47 #endif