-
Notifications
You must be signed in to change notification settings - Fork 462
DDSTextureLoader
DirectXTex |
---|
This is a simple light-weight DirectDraw Surface (.dds
) file loader. This is the traditional texture file container for DirectX. This loader performs no pixel data conversions. This is ideal for runtime usage, and supports the full complement of Direct3D 11 texture resources (1D, 2D, volume maps, cubemaps, mipmap levels, texture arrays, cubemap arrays, Block Compressed formats, etc.). It supports both legacy DDPIXELFORMAT
and 'DX10' DXGI_FORMAT
extension header format .dds
files.
This is the standalone version of these functions. They are also integrated into the DirectX Tool Kit.
HRESULT CreateDDSTextureFromMemory(
LPDIRECT3DDEVICE9 d3dDevice,
const uint8_t* ddsData,
size_t ddsDataSize,
LPDIRECT3DBASETEXTURE9* texture,
bool generateMipsIfMissing = false);
HRESULT CreateDDSTextureFromFile(
LPDIRECT3DDEVICE9 d3dDevice,
const wchar_t* fileName,
LPDIRECT3DBASETEXTURE9* texture,
bool generateMipsIfMissing = false);
HRESULT CreateDDSTextureFromMemoryEx(
LPDIRECT3DDEVICE9 d3dDevice,
const uint8_t* ddsData,
size_t ddsDataSize,
DWORD usage,
D3DPOOL pool,
bool generateMipsIfMissing,
LPDIRECT3DBASETEXTURE9* texture);
HRESULT CreateDDSTextureFromFileEx(
LPDIRECT3DDEVICE9 d3dDevice,
const wchar_t* fileName,
DWORD usage,
D3DPOOL pool,
bool generateMipsIfMissing,
LPDIRECT3DBASETEXTURE9* texture);
HRESULT CreateDDSTextureFromMemory(
LPDIRECT3DDEVICE9 d3dDevice,
const uint8_t* ddsData,
size_t ddsDataSize,
LPDIRECT3DTEXTURE9* texture,
bool generateMipsIfMissing = false);
HRESULT CreateDDSTextureFromFile(
LPDIRECT3DDEVICE9 d3dDevice,
const wchar_t* fileName,
LPDIRECT3DTEXTURE9* texture,
bool generateMipsIfMissing = false);
HRESULT CreateDDSTextureFromMemory(
LPDIRECT3DDEVICE9 d3dDevice,
const uint8_t* ddsData,
size_t ddsDataSize,
LPDIRECT3DCUBETEXTURE9* texture);
HRESULT CreateDDSTextureFromFile(
LPDIRECT3DDEVICE9 d3dDevice,
const wchar_t* fileName,
LPDIRECT3DCUBETEXTURE9* texture);
HRESULT CreateDDSTextureFromMemory(
LPDIRECT3DDEVICE9 d3dDevice,
const uint8_t* ddsData,
size_t ddsDataSize,
LPDIRECT3DVOLUMETEXTURE9* texture);
HRESULT CreateDDSTextureFromFile(
LPDIRECT3DDEVICE9 d3dDevice,
const wchar_t* fileName,
LPDIRECT3DVOLUMETEXTURE9* texture);
HRESULT CreateDDSTextureFromMemoryEx(
LPDIRECT3DDEVICE9 d3dDevice,
const uint8_t* ddsData,
size_t ddsDataSize,
DWORD usage,
D3DPOOL pool,
bool generateMipsIfMissing,
LPDIRECT3DTEXTURE9* texture);
HRESULT CreateDDSTextureFromFileEx(
LPDIRECT3DDEVICE9 d3dDevice,
const wchar_t* fileName,
DWORD usage,
D3DPOOL pool,
bool generateMipsIfMissing,
LPDIRECT3DTEXTURE9* texture);
HRESULT CreateDDSTextureFromMemoryEx(
LPDIRECT3DDEVICE9 d3dDevice,
const uint8_t* ddsData,
size_t ddsDataSize,
DWORD usage,
D3DPOOL pool,
LPDIRECT3DCUBETEXTURE9* texture);
HRESULT CreateDDSTextureFromFileEx(
LPDIRECT3DDEVICE9 d3dDevice,
const wchar_t* fileName,
DWORD usage,
D3DPOOL pool,
LPDIRECT3DCUBETEXTURE9* texture);
HRESULT CreateDDSTextureFromMemoryEx(
LPDIRECT3DDEVICE9 d3dDevice,
const uint8_t* ddsData,
size_t ddsDataSize,
DWORD usage,
D3DPOOL pool,
LPDIRECT3DVOLUMETEXTURE9* texture);
HRESULT CreateDDSTextureFromFileEx(
LPDIRECT3DDEVICE9 d3dDevice,
const wchar_t* fileName,
DWORD usage,
D3DPOOL pool,
LPDIRECT3DVOLUMETEXTURE9* texture);
'DX10' extended header files are not supported for Direct3D 9.
See DirectX Tool Kit for DX11.
See DirectX Tool Kit for DX12.
These functions will succeed with an S_OK
or will return a HRESULT error code (E_INVALIDARG
, E_OUTOFMEMORY
, E_FAIL
, E_POINTER
, E_UNEXPECTED
, HRESULT_FROM_WIN32(ERROR_INVALID_DATA)
, HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)
, HRESULT_FROM_WIN32(ERROR_HANDLE_EOF)
, HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW)
, or in some cases an HRESULT_FROM_WIN32
result from a Win32 function failure).
These functions are marked noexcept
, and do not throw C++ exceptions.
These modules are not included in the DirectXTex.lib. To use them directly add the appropriate .cpp and .h file from the DDSTextureLoader
folder to your project -or- use the DirectX Tool Kit.
All content and source code for this package are subject to the terms of the MIT License.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
- Universal Windows Platform apps
- Windows desktop apps
- Windows 11
- Windows 10
- Windows 8.1
- Xbox One
- Xbox Series X|S
- Windows Subsystem for Linux
- x86
- x64
- ARM64
- Visual Studio 2022
- Visual Studio 2019 (16.11)
- clang/LLVM v12 - v20
- GCC 10.5, 11.4, 12.3, 13.3, 14.2
- MinGW 12.2, 13.2
- CMake 3.21
DirectX Tool Kit for DirectX 11