Minor Update - ImGui tweak

[FEAT] :

~ Modification de l'interface ImGui
This commit is contained in:
2024-04-22 17:55:48 +02:00
parent 7ef81b9c91
commit 6316d4cb2b
14 changed files with 173 additions and 138 deletions

View File

@@ -399,7 +399,6 @@ void ModelClass::CalculateModelVectors()
void ModelClass::CalculateTangentBinormal(TempVertexType vertex1, TempVertexType vertex2, TempVertexType vertex3, VectorType& tangent, VectorType& binormal)
{
Logger::Get().Log("Calculating tangent and binormal", __FILE__, __LINE__);
float vector1[3], vector2[3];
float tuVector[2], tvVector[2];
@@ -451,8 +450,6 @@ void ModelClass::CalculateTangentBinormal(TempVertexType vertex1, TempVertexType
binormal.y = binormal.y / length;
binormal.z = binormal.z / length;
Logger::Get().Log("Tangent and binormal calculated", __FILE__, __LINE__);
return;
}
@@ -469,4 +466,27 @@ void ModelClass::ReleaseModel()
Logger::Get().Log("Model released", __FILE__, __LINE__);
return;
}
bool ModelClass::ChangeTexture(ID3D11Device* device, ID3D11DeviceContext* deviceContext, std::wstring filename, int index)
{
bool result;
// convert wstring to string
std::string str(filename.begin(), filename.end());
// Release the old texture object.
m_Textures[index].Shutdown();
// Initialize the new texture object.
result = m_Textures[index].Initialize(device, deviceContext, str);
if (!result)
{
Logger::Get().Log("Failed to initialize texture", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
Logger::Get().Log("Texture changed", __FILE__, __LINE__);
return true;
}