Creates a texture resource and a shader resource view, given a path to a .DDS file.
HRESULT CreateDDSTextureFromFile(
ID3D11Device *d3dDevice,
const wchar_t *szFileName,
ID3D11Resource **texture,
ID3D11ShaderResourceView **textureView,
size_t maxsize
)
d3dDevice
Type: ID3D11Device *
[in] The DirectX 11 device created on initialization.
szFileName
Type: wchar_t *
Path of the .DDS file.
texture
Type: ID3D11Resource **
Pointer to a texture resource to be created.
textureView
Type: ID3D11ShaderResourceView **
Pointer to a shader resourse view to be created.
maxsize
Type: size_t
[in] If non-zero, this is the maximum size of mipmap level to load and create. If this is set to zero then no mipmap levels are created if the method succeeds, but if the method fails and there are mipmaps present, then a second attempt will be made with the maxmimum mipmap level determined by the DirectX feature level setting. The purpose of this parameter is to enable some load balancing.
Type: HRESULT
This method does not perform any format conversion. It does support 1D, 2D, mipmap levels, volume maps, cube maps, compression formats, and texture arrays.
This method can be found in the DDSTextureLoader.cpp file, included along with the DirectXTex files in the Xbox One samples.
Header: Declared in DDSTextureLoader.h.