]> git.tdb.fi Git - libs/gl.git/blob - source/technique.h
Use texture unit numbers instead of slot names in RenderPass
[libs/gl.git] / source / technique.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 TECHNIQUE_H_
9 #define TECHNIQUE_H_
10
11 #include "renderpass.h"
12
13 namespace Msp {
14 namespace GL {
15
16 class Material;
17 class Tag;
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(unsigned, const std::string &);
45         };
46
47         typedef std::map<Tag, RenderPass> PassMap;
48
49         PassMap passes;
50
51 public:
52         bool has_pass(const GL::Tag &) const;
53         const RenderPass &get_pass(const GL::Tag &) const;
54         const PassMap &get_passes() const { return passes; }
55 };
56
57 } // namespace GL
58 } // namespace Msp
59
60 #endif