goat3d
annotate src/material.h @ 60:0c3576325480
moving the exporter along slowly
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 30 Mar 2014 08:53:33 +0300 |
parents | f1b4c27382ce |
children | dad392c710df |
rev | line source |
---|---|
nuclear@0 | 1 #ifndef MATERIAL_H_ |
nuclear@0 | 2 #define MATERIAL_H_ |
nuclear@0 | 3 |
nuclear@1 | 4 #include <string> |
nuclear@1 | 5 #include <map> |
nuclear@1 | 6 #include <vmath/vmath.h> |
nuclear@1 | 7 |
nuclear@47 | 8 namespace g3dimpl { |
nuclear@47 | 9 |
nuclear@1 | 10 struct MaterialAttrib { |
nuclear@1 | 11 Vector4 value; |
nuclear@1 | 12 std::string map; |
nuclear@15 | 13 |
nuclear@15 | 14 MaterialAttrib() : value(1, 1, 1, 1) {} |
nuclear@1 | 15 }; |
nuclear@1 | 16 |
nuclear@0 | 17 class Material { |
nuclear@1 | 18 private: |
nuclear@1 | 19 static MaterialAttrib def_attr; |
nuclear@1 | 20 |
nuclear@1 | 21 std::map<std::string, MaterialAttrib> attrib; |
nuclear@1 | 22 |
nuclear@1 | 23 public: |
nuclear@8 | 24 std::string name; |
nuclear@8 | 25 |
nuclear@9 | 26 int get_attrib_count() const; |
nuclear@9 | 27 const char *get_attrib_name(int idx) const; |
nuclear@1 | 28 |
nuclear@9 | 29 MaterialAttrib &operator [](int idx); |
nuclear@9 | 30 const MaterialAttrib &operator [](int idx) const; |
nuclear@9 | 31 |
nuclear@9 | 32 MaterialAttrib &operator [](const std::string &name); |
nuclear@9 | 33 const MaterialAttrib &operator [](const std::string &name) const; |
nuclear@0 | 34 }; |
nuclear@0 | 35 |
nuclear@47 | 36 } // namespace g3dimpl |
nuclear@47 | 37 |
nuclear@0 | 38 #endif // MATERIAL_H_ |