#ifndef MODEL_LOADER_H #define MODEL_LOADER_H #include #include #include #include #include #include #include "Mesh.h" #include "TextureLoader.h" using namespace DirectX; class ModelLoader { public: ModelLoader(); ~ModelLoader(); bool Load(HWND hwnd, ID3D11Device* dev, ID3D11DeviceContext* devcon, std::string filename); void Draw(ID3D11DeviceContext* devcon); void Close(); private: ID3D11Device *dev_; ID3D11DeviceContext *devcon_; std::vector meshes_; std::string directory_; std::vector textures_loaded_; HWND hwnd_; void processNode(aiNode* node, const aiScene* scene); Mesh processMesh(aiMesh* mesh, const aiScene* scene); std::vector loadMaterialTextures(aiMaterial* mat, aiTextureType type, std::string typeName, const aiScene* scene); ID3D11ShaderResourceView* loadEmbeddedTexture(const aiTexture* embeddedTexture); }; #endif // !MODEL_LOADER_H