Hello,
I am learning Direct3D and I am following this lesson.
When I was supposed to to load a texture using:
HRESULT D3DX11CreateShaderResourceViewFromFile(
_In_ ID3D11Device *pDevice,
_In_ LPCTSTR pSrcFile,
_In_ D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
_In_ ID3DX11ThreadPump *pPump,
_Out_ ID3D11ShaderResourceView **ppShaderResourceView,
_Out_ HRESULT *pHResult
);
I came across microsoft reference , stating:
Note The D3DX (D3DX 9, D3DX 10, and D3DX 11) utility library is deprecated for Windows 8 and is not supported for Windows Store apps.
Note Instead of using this function, we recommend that you use these:
- DirectXTK library (runtime), CreateXXXTextureFromFile (where XXX is DDS or WIC)
- DirectXTex library (tools), LoadFromXXXFile (where XXX is WIC, DDS, or TGA; WIC doesn't support DDS and TGA; D3DX 9 supported TGA as a common art source format for games) then CreateShaderResourceView
So I went ahead and downloaded "DirectXTex.zip" from DirectXTex .
I unzip it, place it in some random directory... and end up looking at "DirectXTex\DDSTextureLoader" containing the ".h" and ".cpp" files.
I link those files to my project (after painful failures and simply pointing to additional includes to ".h" and linking ".cpp" by dragging to project instead of failing documentation) and use
// Load texture.
CreateDDSTextureFromFile(dev, L"poop.jpg", 0, &cubesTexture);
(Without knowing what "DDS" actually means, skipping the overly-complicated text on the internet) ... wham.. bham... and it compiles.
I launch it... and...
Any idea on how to whack this sucker? I'm currently stuck and unable to continue, so any help would be much appreciated.
-----
I have tried compiling it into a library using visual studio project files from "DirectXTex\DirectXTex" and linking via "additional library paths" (or similar name) and putting a dependency of generated ".lib" in the linker. This failed to even compile with an unresolved external symbol (needles to say the linker didn't like it).