-
Notifications
You must be signed in to change notification settings - Fork 479
Integration
In your application's solution, right-click on the Solution and use "Add \ Existing Project..." to add the appropriate .vcxproj file to your solution.
| DirectXTex_Desktop_2026 | Windows desktop applications for Windows 10 or later building with VS 2026 Community, Professional or higher with the latest installed Windows SDK. |
| DirectXTex_Desktop_2022 | Windows desktop applications for Windows 8.1 or later building with VS 2022 Community, Professional or higher with the latest installed Windows SDK. |
| DirectXTex_Desktop_2022_Win10 | Windows desktop applications for Windows 10/Windows 11 building with VS 2022 Community, Professional or higher with with the latest installed Windows SDK. This includes DirectX 12 support. |
| DirectXTex_Windows10_2022 | Universal Windows Platform (UWP) apps building with VS 2022 with the latest installed Windows SDK. This includes DirectX 12 support. |
| DirectXTex_GDK_2022 | Windows 10, Windows 11, and Xbox games building with VS 2022 using the Microsoft GDK. |
| DirectXTex_GDKX_2022 | Xbox games building with VS 2022 using the Microsoft GDK. |
For VS 2022, use of the 17.12 is required as all previous versions are no longer supported.
In your application's project, right-click on the Project and use "References...", then "Add New Reference...", and then check the DirectXTex project name and click OK. For a Universal Windows Platform (UWP) app or Xbox One solution, you need to set Reference Assembly Output to false since DirectXTex is a static C++ library and not a WinRT component.
In your application's project settings, on the "C++ / General" page set Configuration to "All Configurations", set Platform to "All Platforms", and then add the relative path to DirectXTex;--assuming you have the DirectXTex folder in the same directory as your sln file, it should be $(SolutionDir$)\DirectXTex;--to the Additional Include Directories properties. Click Apply.
See the Visual C++ Team Blog
DirectXTex was never supported on Windows Phone 8.0, because WIC is not available on that platform. The
.DDSfiles it generates are suitable for use on Windows Phone 8.x assuming the pixel format is supported by the device (Feature Level 9.3).
Alternatively you can use NuGet to install one of the DirectXTex packages. Use Project / Manage NuGet Packages... then select "Online" and search for "DirectXTex".
| directxtex_desktop_win10 | This NuGet package is configured for Windows desktop C++ applications building with VS 2019 or VS 2022 Community/Professional or higher for Windows 10/Windows 11.This includes DirectX 12 support and ARM64 binaries. |
| directxtex_uwp | This NuGet package is configured for Universal Windows Platform apps for Windows 10/Windows 11 building with VS 2022 Community/Professional or higher. This includes DirectX 12 support and ARM64 binaries. |
You should use the NuGet interface to check for updates if you have an older version installed.
These packages are no longer supported:
- Windows desktop app using VS 2019
- Windows desktop app using VS 2017
- Windows desktop app using VS 2015
DirectXTex is also available through the vcpkg C++ Library Manager.
Using 'manifest-mode' is the recommended way to integrate VCPKG into your project.
For 'system-wide' access, use:
vcpkg install directxtex
For the 64-bit version of the library, use:
vcpkg install directxtex:x64-windows
For the Universal Windows Platform (UWP) versions, use:
vcpkg install directxtex:x64-uwp
arm,arm64,x86,x64,windows,windows-static,windows-static-md, anduwptriplets are supported.
The vcpkg port supports five optional features. The default is to build with DirectX 11 support, but without DirectX 12 support except for UWP which always includes it.
-
dx11: Adds DirectX 11 API support functions for Windows desktop or UWP. -
dx12: Adds DirectX 12 API support functions for Windows 10/Windows 11 -
tools: Installs texture command-line tools -
spectre: Builds the library with Spectre-mitigation enabled -
openexr: Adds OpenEXR support -
xbox: Adds support for Xbox off-line content processing; requires the Microsoft GDK with Xbox Extensions
For Windows Subsystem for Linux, use:
./vcpkg install directxtex:x64-linux
./vcpkg install directxtex:arm64-linux
To add the JPEG/PNG auxiliary functions for Linux:
./vcpkg install directxtex[jpeg,png]:x64-linux
Non-Win32 support requires a C++17 conformant compiler & library. GNUC 9 will work; GNUC 11.3 or later is recommended.
For Xbox Series X|S with the Microsoft GDK with Xbox Extensions installed:
vcpkg install directxtex:x64-xbox-scarlett
For Xbox One with the Microsoft GDK with Xbox Extensions installed:
vcpkg install directxtex:x64-xbox-xboxone
If using vcpkg+MSBuild integration and the DLL versions of the libraries (i.e. not the -static triplets), you will need to manually define the preprocessor symbol
DIRECTX_TEX_IMPORTor you will get link errors. This is automatically set for CMake integration when using CMake targets.
You can reference the DirectXTex CMake package using:
find_package(directxtex CONFIG REQUIRED)
target_link_libraries(foo Microsoft::DirectXTex)
If using CMakePresets.json set the environment variable VCPKG_ROOT and add:
"cacheVariables": {
CMAKE_TOOLCHAIN_FILE": {
value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"type": "FILEPATH"
}
},
If not using vcpkg, you have to provide a per-configuration path to the individual installed package in the directxtex_DIR variable. Otherwise the find_package will fail.
With Visual Studio 2022 Update 6 or later, VCPKG is available via Microsoft.VisualStudio.Component.Vcpkg. Use of 'manifest-mode' is recommended.
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 opencode@microsoft.com 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 2026
- Visual Studio 2022 (17.12 or later)
- 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