#ifndef MESH_H #define MESH_H #include "Prerequisites.h" #include "Resource.h" #include class Mesh : public Resource { public: Mesh(); Mesh(const std::string& name, const std::string& path = "./"); //used if only need one material/texture that isn't defined in the model file Mesh(const std::string& name, const std::string& path, const std::string& textureName, D3DMATERIAL9& mtrl); ~Mesh(); void SetMaterial(const std::string& name, const std::string& path); void Draw(int subset); inline ID3DXMeshPtr GetMesh() const { return mMesh; } inline const std::vector& GetMaterials() const { return mMaterials; } protected: ID3DXMeshPtr mMesh; //d3d mesh std::vector mMaterials; //materials that coincide with the mesh parts void LoadXFile(); }; #endif