Jul 29, 2016 at 7:51 AM
Edited Jul 29, 2016 at 7:52 AM
There's no reason to use DirectXTex here. DirectX Tool Kit is the better option for runtime use per
this blog post
From the tiny snippet of code you provided, I can't tell why you had a memory leak, but the code looks pretty odd as you've written it. Normally you create the EffectFactory instance as a member variable and keep it around, something like:
// in your class's header file
// in your class' implementation file
m_effectFactory = std::make_unique<EffectFactory>(D3D11RENDERER->GetDevice());
You are probably just using the smart-pointer system incorrectly.
You don't need to use an EffectFactory at all to load a texture as you can directly use the
functions. The only reason to use EffectFactory is have it deal with caching by file name.
You should have a run through the
and see if helps clarify your understanding.