]> git.tdb.fi Git - libs/gl.git/blob - source/materials/unlitmaterial.h
4481d5f988f446d446c048303666803c0af44e46
[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 &, Collection &);
19
20         private:
21                 virtual void init_actions();
22
23                 void texture(const std::string &);
24         };
25
26 private:
27         const Texture *texture;
28         Color color;
29         bool vertex_color;
30
31         static const Tag texture_tags[];
32
33 public:
34         UnlitMaterial();
35
36 protected:
37         virtual void fill_program_info(std::string &, std::map<std::string, int> &) const;
38
39 public:
40         virtual const Tag *get_texture_tags() const { return texture_tags; }
41         virtual const Texture *get_texture(Tag) const;
42
43         void set_texture(const Texture *);
44         void set_color(const Color &);
45         void set_vertex_color(bool);
46 };
47
48 } // namespace GL
49 } // namespace Msp
50
51 #endif