]> git.tdb.fi Git - libs/gl.git/blob - source/technique.h
7c384f469bb0084770191484e4bcea315691efc6
[libs/gl.git] / source / technique.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2008-2011  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef TECHNIQUE_H_
9 #define TECHNIQUE_H_
10
11 #include "renderpass.h"
12 #include "tag.h"
13
14 namespace Msp {
15 namespace GL {
16
17 class Material;
18 class Texture;
19
20 /**
21 */
22 class Technique
23 {
24 public:
25         class Loader: public Msp::DataFile::CollectionObjectLoader<Technique>
26         {
27         public:
28                 Loader(Technique &);
29                 Loader(Technique &, Collection &);
30
31         private:
32                 void init();
33                 void inherit(const std::string &);
34                 void pass(const std::string &);
35         };
36
37 private:
38         class InheritLoader: public Msp::DataFile::CollectionObjectLoader<Technique>
39         {
40         public:
41                 InheritLoader(Technique &, Collection &);
42         
43         private:
44                 void texture(const std::string &, const std::string &);
45         };
46
47         typedef std::map<Tag, RenderPass> PassMap;
48
49         PassMap passes;
50
51 public:
52         RenderPass &add_pass(const GL::Tag &);
53         bool has_pass(const GL::Tag &) const;
54         const RenderPass &get_pass(const GL::Tag &) const;
55         const PassMap &get_passes() const { return passes; }
56 };
57
58 } // namespace GL
59 } // namespace Msp
60
61 #endif