]> git.tdb.fi Git - libs/gl.git/blob - source/materials/unlitmaterial.h
dc027f1f6a79ccc7a400aa5311e1081e056729da
[libs/gl.git] / source / materials / unlitmaterial.h
1 #ifndef MSP_GL_UNLITMATERIAL_H_
2 #define MSP_GL_UNLITMATERIAL_H_
3
4 #include "material.h"
5
6 namespace Msp {
7 namespace GL {
8
9 class UnlitMaterial: public Material
10 {
11 public:
12         class Loader: public DataFile::DerivedObjectLoader<UnlitMaterial, Material::PropertyLoader<UnlitMaterial> >
13         {
14         private:
15                 static ActionMap shared_actions;
16
17         public:
18                 Loader(UnlitMaterial &);
19                 Loader(UnlitMaterial &, Collection &);
20
21         private:
22                 virtual void init_actions();
23
24                 void texture(const std::string &);
25         };
26
27 private:
28         const Texture *texture;
29         Color color;
30         bool vertex_color;
31
32         static const Tag texture_tags[];
33
34 public:
35         UnlitMaterial();
36
37 protected:
38         virtual void fill_program_info(std::string &, std::map<std::string, int> &) const;
39
40 public:
41         virtual const Tag *get_texture_tags() const { return texture_tags; }
42         virtual const Texture *get_texture(Tag) const;
43
44         void set_texture(const Texture *);
45         void set_color(const Color &);
46         void set_vertex_color(bool);
47 };
48
49 } // namespace GL
50 } // namespace Msp
51
52 #endif