This tutorial will demonstrate how to load texture in Direct3D 11
Interfaces used:
ID3D11ShaderResourceView
std::wstring oTexturePathString = L"c:\\textures\\hello.dds"; // Replace this file path with the texture that you want to load
ID3D11ShaderResourceView *pD3DShaderResourceView;
CHECK_COM(::D3DX11CreateShaderResourceViewFromFile(g_pD3DDevice, oTexturePathString.data(), nullptr, nullptr, &pD3DShaderResourceView, nullptr));
Now bind the created SRV to the shader to see the bound texture
Interfaces used:
ID3D11ShaderResourceView
std::wstring oTexturePathString = L"c:\\textures\\hello.dds"; // Replace this file path with the texture that you want to load
ID3D11ShaderResourceView *pD3DShaderResourceView;
CHECK_COM(::D3DX11CreateShaderResourceViewFromFile(g_pD3DDevice, oTexturePathString.data(), nullptr, nullptr, &pD3DShaderResourceView, nullptr));
Now bind the created SRV to the shader to see the bound texture
No comments:
Post a Comment