]> git.tdb.fi Git - libs/gl.git/blob - source/texturing.h
Exclude EnvironMap effect itself when creating the map
[libs/gl.git] / source / texturing.h
1 #ifndef MSP_GL_TEXTURING_H_
2 #define MSP_GL_TEXTURING_H_
3
4 #include <vector>
5 #include "bindable.h"
6
7 namespace Msp {
8 namespace GL {
9
10 class TexEnv;
11 class Texture;
12
13 class Texturing: public Bindable<Texturing>
14 {
15 private:
16         struct Attachment
17         {
18                 const Texture *tex;
19                 const TexEnv *env;
20
21                 Attachment();
22         };
23
24         std::vector<Attachment> attachments;
25
26 public:
27         ~Texturing();
28
29         void attach(unsigned, const Texture &);
30         void attach(unsigned, const Texture &, const TexEnv &);
31         void detach(unsigned);
32 private:
33         void set_attachment(unsigned, const Texture *, const TexEnv *);
34         void bind_attachment(unsigned) const;
35
36         static void unbind_attachment(unsigned);
37
38 public:
39         void bind() const;
40
41         static void unbind();
42 };
43
44 } // namespace GL
45 } // namespace Msp;
46
47 #endif