microsoft/directxtk/directxtk-usage
Claude Code and agent skill by microsoft/directxtk
- vendor
Checking that the SKILL.md file is still in the repository.
Guide for integrating DirectX Tool Kit for DirectX 11 into new projects and understanding the API surface. Use this skill when asked about how to use DirectX Tool Kit, integrate it into a project, or get an overview of its classes and functionality.
Install
npx vskill@latest install microsoft/directxtk/directxtk-usageSKILL.md
The same SKILL.md was published earlier as microsoft/directxtk/directxtk-usage.
DirectX Tool Kit for DirectX 11 — Usage Guide
Overview
The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++. It is designed to be used as a shared source project, NuGet package, or vcpkg port integrated into your game or graphics application.
- Repository: <https://github.com/microsoft/DirectXTK>
- Documentation: <https://github.com/microsoft/DirectXTK/wiki>
- NuGet Packages:
directxtk_desktop_win10,directxtk_uwp - vcpkg Port:
directxtk
Integration Methods
vcpkg manifest-mode (Recommended)
In your vcpkg.json file, add the following:
If using GameInput for the game input functionality, add the following:
If using DirectX Tool Kit for Audio and GameInput, add the following:
vcpkg (classic)
Features: xaudio2-9 (DirectX Tool Kit for Audio using XAudio 2.9), gameinput (Using GameInput for gamepad, keyboard, and mouse), tools (command-line tools). Triplets: x64-windows, arm64-windows, etc.
For DLL usage (x64-windows default triplet), define DIRECTX_TOOLKIT_IMPORT in your consuming project. For static library usage, use -static-md triplet variants.
CMakeLists.txt:
See the d3d11game_vcpkg template for a complete example.
NuGet
Use directxtk_desktop_win10 for Win32 desktop applications or directxtk_uwp for UWP apps.
Project Reference
Add the appropriate .vcxproj from the DirectXTK/ folder to your solution and add a project reference. Add the DirectXTK\Inc directory to your Additional Include Directories.
Minimum Setup
Every DirectXTK application needs:
- A Direct3D 11 device
- A Direct3D immediate device context
- The application is responsible for the rendering, SwapChain management, and Present loop
API Reference
The public API is defined in the header files in the Inc/ directory. See the reference overview for a categorized summary of all classes and helpers.
Full documentation for each class is available on the GitHub wiki.
API signatures are defined in the public headers under the Inc/ directory. Always consult those headers for the authoritative function signatures, parameters, and SAL annotations.
Key Concepts
Resource Ownership
DirectXTK classes follow RAII principles. Most objects are created with std::make_unique and destroyed automatically. COM resources are managed with Microsoft::WRL::ComPtr.
Device-Dependent vs Device-Independent
Most DirectXTK objects are device-dependent — they are created with a ID3D11Device* and must be recreated if the device is lost. Plan your resource management accordingly.
Thread Safety
DirectXTK rendering classes (SpriteBatch, Effects, PrimitiveBatch, etc.) are not thread-safe. Use one instance per thread, or synchronize access externally. Resource creation (texture loading, model loading) can be done from any thread.
Namespace
All classes and functions reside in the DirectX namespace. Headers that contain Direct3D 11-specific types use inline namespace DX11 to avoid conflicts when both DX11 and DX12 toolkits are linked together.
Common Patterns
Drawing Sprites
Loading and Drawing a 3D Model
Drawing Geometric Primitives
Using Effects
Input Handling
Audio
Getting Started Tutorial
For a full step-by-step walkthrough, see the Getting Started tutorial on the wiki.
Further Reading
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 9 Sep 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/directxtk-usage/SKILL.md
Popularity
- Repository stars
- 2,855
- Repository forks
- 537
- 7-day trend score
- 40
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/directxtk/directxtk-usage)