]> git.tdb.fi Git - libs/gl.git/blob - source/materials/unlitmaterial.h
Add inline data items to the collection
[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 #pragma GCC diagnostic push
42 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
43         DEPRECATED virtual void attach_textures_to(Texturing &, ProgramData &) const;
44 #pragma GCC diagnostic pop
45
46         virtual const Tag *get_texture_tags() const { return texture_tags; }
47         virtual const Texture *get_texture(Tag) const;
48
49         void set_texture(const Texture *);
50         void set_color(const Color &);
51         void set_vertex_color(bool);
52 };
53
54 } // namespace GL
55 } // namespace Msp
56
57 #endif