goat3d

view src/material.h @ 53:6d514398a728

fixed a merge mistake
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 17 Jan 2014 18:30:35 +0200
parents f1b4c27382ce
children dad392c710df
line source
1 #ifndef MATERIAL_H_
2 #define MATERIAL_H_
4 #include <string>
5 #include <map>
6 #include <vmath/vmath.h>
8 namespace g3dimpl {
10 struct MaterialAttrib {
11 Vector4 value;
12 std::string map;
14 MaterialAttrib() : value(1, 1, 1, 1) {}
15 };
17 class Material {
18 private:
19 static MaterialAttrib def_attr;
21 std::map<std::string, MaterialAttrib> attrib;
23 public:
24 std::string name;
26 int get_attrib_count() const;
27 const char *get_attrib_name(int idx) const;
29 MaterialAttrib &operator [](int idx);
30 const MaterialAttrib &operator [](int idx) const;
32 MaterialAttrib &operator [](const std::string &name);
33 const MaterialAttrib &operator [](const std::string &name) const;
34 };
36 } // namespace g3dimpl
38 #endif // MATERIAL_H_