MCPcopy Create free account
hub / github.com/TheRealMJP/Shadows / LoadMaterialResources

Method LoadMaterialResources

Shadows/SampleFramework11/Model.cpp:656–668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

654}
655
656void Model::LoadMaterialResources(MeshMaterial& material, const wstring& directory, ID3D11Device* device)
657{
658 // Load the diffuse map
659 wstring diffuseMapPath = directory + material.DiffuseMapName;
660 if(material.DiffuseMapName.length() > 1 && FileExists(diffuseMapPath.c_str()))
661 material.DiffuseMap = LoadTexture(device, diffuseMapPath.c_str());
662
663 // Load the normal map
664 wstring normalMapPath = directory + material.NormalMapName;
665
666 if(material.NormalMapName.length() > 1 && FileExists(normalMapPath.c_str()))
667 material.NormalMap = LoadTexture(device, normalMapPath.c_str());
668}
669
670void Model::WriteToFile(const wchar* path, ID3D11Device* device, ID3D11DeviceContext* context)
671{

Callers

nothing calls this directly

Calls 2

FileExistsFunction · 0.85
LoadTextureFunction · 0.85

Tested by

no test coverage detected