The DDS Texture Loader module provides two methods for loading DDS (Direct Draw Surface) images or files as textures.
| Method | Description |
|---|---|
| CreateDDSTextureFromFile | Creates a texture resource and a shader resource view, given a path to a .DDS file. |
| CreateDDSTextureFromMemory | Creates a texture resource and a shader resource view, given the image of a file in a memory buffer. |
An optional parameter for both methods determines a maximum size for mipmap levels (mipmap levels larger than the given size are ignored).
The methods do no perform any data conversions, the much larger DirectXTex library can be used if format conversion is required. The two methods do support a full range of texture resources, including 1D, 2D, mipmap levels, volume maps, cube maps, compression formats, and texture arrays. If a file or image is input to these methods that does not match exactly to a DXGI format, then the methods will return an error code.
This module is useful for a runtime DDS texture system, if the textures can be prepared and converted to DDS format outside of the title. Only two files are required: DDSTextureLoader.cpp and DDSTextureLoader.h. Access these files from one of the provided samples, such as Bokeh, and will be in the folder:
...\Bokeh_10_2012\Common\DirectXTex
The DDS Texture Loader module is used for the samples provided for Xbox One (refer to Running the XDK Samples).
The DDSTextureLoader module is also included in the DirectX Tool Kit library, and a standalone version is included in the DirectXTex package.