goat3d

view src/material.h @ 15:f1b4c27382ce

blah
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 26 Sep 2013 14:06:14 +0300
parents 04bb114fcf05
children 498ca7ac7047
line source
1 #ifndef MATERIAL_H_
2 #define MATERIAL_H_
4 #include <string>
5 #include <map>
6 #include <vmath/vmath.h>
8 struct MaterialAttrib {
9 Vector4 value;
10 std::string map;
12 MaterialAttrib() : value(1, 1, 1, 1) {}
13 };
15 class Material {
16 private:
17 static MaterialAttrib def_attr;
19 std::map<std::string, MaterialAttrib> attrib;
21 public:
22 std::string name;
24 int get_attrib_count() const;
25 const char *get_attrib_name(int idx) const;
27 MaterialAttrib &operator [](int idx);
28 const MaterialAttrib &operator [](int idx) const;
30 MaterialAttrib &operator [](const std::string &name);
31 const MaterialAttrib &operator [](const std::string &name) const;
32 };
34 #endif // MATERIAL_H_