]> git.tdb.fi Git - libs/gl.git/blob - source/technique.h
Add a function to query if a Technique has any shaders
[libs/gl.git] / source / technique.h
1 #ifndef TECHNIQUE_H_
2 #define TECHNIQUE_H_
3
4 #include "renderpass.h"
5 #include "tag.h"
6
7 namespace Msp {
8 namespace GL {
9
10 class Material;
11 class Texture;
12
13 /**
14 */
15 class Technique
16 {
17 public:
18         class Loader: public Msp::DataFile::CollectionObjectLoader<Technique>
19         {
20         public:
21                 Loader(Technique &);
22                 Loader(Technique &, Collection &);
23
24         private:
25                 void init();
26                 void inherit(const std::string &);
27                 void pass(const std::string &);
28         };
29
30 private:
31         class InheritLoader: public Msp::DataFile::CollectionObjectLoader<Technique>
32         {
33         public:
34                 InheritLoader(Technique &, Collection &);
35         
36         private:
37                 void texture(const std::string &, const std::string &);
38         };
39
40 public:
41         typedef std::map<Tag, RenderPass> PassMap;
42
43 private:
44         PassMap passes;
45
46 public:
47         RenderPass &add_pass(const GL::Tag &);
48         bool has_pass(const GL::Tag &) const;
49         const RenderPass &get_pass(const GL::Tag &) const;
50         const PassMap &get_passes() const { return passes; }
51         bool has_shaders() const;
52 };
53
54 } // namespace GL
55 } // namespace Msp
56
57 #endif