MAJOR UPDATE - BROKEN

- New way of loading Texture
This commit is contained in:
2024-09-28 20:16:44 +02:00
parent 6a8172ab1f
commit e20a2aa365
32 changed files with 10727 additions and 117 deletions

View File

@@ -17,6 +17,23 @@ Object::Object() : ModelClass()
Object::~Object()
{
if (m_Texture) {
m_Texture->Release();
m_Texture = nullptr;
}
}
bool Object::LoadTexture(ID3D11Device* device, ID3D11DeviceContext* deviceContext, const std::wstring& filename) {
HRESULT result = DirectX::CreateWICTextureFromFile(device, deviceContext, filename.c_str(), nullptr, &m_Texture);
if (FAILED(result)) {
return false;
}
return true;
}
ID3D11ShaderResourceView* Object::GetTexture() const
{
return m_Texture;
}
void Object::SetScaleMatrix(XMMATRIX scaleMatrix)