X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmaterial.h;h=c46a21dfd26bc6e1be69ead43fc739d5b9018a0c;hb=fb11663a3654acd0132e71e5652e35b0ea72d544;hp=f5c26aefab503cf219c54740ba5ea967e50cfa4b;hpb=b7c92831285013b2a0783bccaf3d900545ebb5ba;p=laserbrain_demo diff --git a/src/material.h b/src/material.h index f5c26ae..c46a21d 100644 --- a/src/material.h +++ b/src/material.h @@ -1,16 +1,43 @@ #ifndef MATERIAL_H_ #define MATERIAL_H_ +#include +#include #include +#include "texture.h" + +enum { + MTL_TEX_DIFFUSE, + MTL_TEX_SPECULAR, + MTL_TEX_NORMALMAP, + MTL_TEX_LIGHTMAP, + MTL_TEX_ENVMAP, + + MTL_TEX_UNKNOWN +}; + +#define NUM_MTL_TEXTURES MTL_TEX_UNKNOWN class Material { public: + std::string name; Vec3 diffuse, specular; float shininess; float alpha; + Texture *stdtex[NUM_MTL_TEXTURES]; + std::vector textures; + Material(); void setup() const; + + void add_texture(Texture *tex, int type = MTL_TEX_UNKNOWN); + void remove_texture(Texture *tex); }; +// returns MTL_TEX_whatever by name +int mtl_parse_type(const char *str); +// returns the name of a material type +const char *mtl_type_string(int type); + #endif // MATERIAL_H_