]> git.tdb.fi Git - libs/gl.git/blob - source/materials/unlitmaterial.h
Check the flat qualifier from the correct member
[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 /**
10 A material which performs no lighting calculations at all.  Useful for HUD
11 graphics.
12 */
13 class UnlitMaterial: public Material
14 {
15 public:
16         class Loader: public DataFile::DerivedObjectLoader<UnlitMaterial, Material::PropertyLoader<UnlitMaterial> >
17         {
18         private:
19                 static ActionMap shared_actions;
20
21         public:
22                 Loader(UnlitMaterial &, Collection &);
23
24         private:
25                 virtual void init_actions();
26
27                 void texture(const std::string &);
28         };
29
30 private:
31         const Texture *texture = 0;
32         Color color;
33         bool vertex_color = false;
34
35         static const Tag texture_tags[];
36
37 public:
38         UnlitMaterial();
39
40 protected:
41         virtual void fill_program_info(std::string &, std::map<std::string, int> &) const;
42
43 public:
44         virtual const Tag *get_texture_tags() const { return texture_tags; }
45         virtual const Texture *get_texture(Tag) const;
46
47         void set_texture(const Texture *);
48         void set_color(const Color &);
49         void set_vertex_color(bool);
50 };
51
52 } // namespace GL
53 } // namespace Msp
54
55 #endif