[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74B347K3MB7P0YYM4G806MZ":3,"skill-same:01M74B347K3MB7P0YYM4G806MZ":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":34,"ownerDescription":35,"updatedAt":36,"install":37,"resources":50},"01M74B347K3MB7P0YYM4G806MZ","directxtk-usage",null,"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.","microsoft\u002FDirectXTK","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M74B2TP1AP5DETV9E1T5V7W8",2872,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fblob\u002Fmain\u002Fskills\u002Fdirectxtk-usage\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: directxtk-usage\ndescription: >-\n  Guide for integrating DirectX Tool Kit for DirectX 11 into new projects and understanding the API surface.\n  Use this skill when asked about how to use DirectX Tool Kit, integrate it into a project,\n  or get an overview of its classes and functionality.\nlicense: MIT\nmetadata:\n  author: chuckw\n  version: \"1.0\"\n---\n\n# DirectX Tool Kit for DirectX 11 — Usage Guide\n\n## Overview\n\nThe *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.\n\n- **Repository**: \u003Chttps:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK>\n- **Documentation**: \u003Chttps:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fwiki>\n- **NuGet Packages**: `directxtk_desktop_win10`, `directxtk_uwp`\n- **vcpkg Port**: `directxtk`\n\n## Integration Methods\n\n### vcpkg manifest-mode (Recommended)\n\nIn your `vcpkg.json` file, add the following:\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fraw.githubusercontent.com\u002Fmicrosoft\u002Fvcpkg-tool\u002Fmain\u002Fdocs\u002Fvcpkg.schema.json\",\n  \"dependencies\": [\n    \"directxmath\",\n    \"directxtk\"\n  ]\n}\n```\n\nIf using GameInput for the game input functionality, add the following:\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fraw.githubusercontent.com\u002Fmicrosoft\u002Fvcpkg-tool\u002Fmain\u002Fdocs\u002Fvcpkg.schema.json\",\n  \"dependencies\": [\n    \"directxmath\",\n    {\n      \"name\": \"directxtk\",\n      \"default-features\": false,\n      \"features\": [\n        \"gameinput\"\n      ]\n    }\n  ]\n}\n```\n\nIf using DirectX Tool Kit for Audio and GameInput, add the following:\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fraw.githubusercontent.com\u002Fmicrosoft\u002Fvcpkg-tool\u002Fmain\u002Fdocs\u002Fvcpkg.schema.json\",\n  \"dependencies\": [\n    \"directxmath\",\n    {\n      \"name\": \"directxtk\",\n      \"default-features\": false,\n      \"features\": [\n        \"gameinput\",\n        \"xaudio2-9\"\n      ]\n    }\n  ]\n}\n```\n\n### vcpkg (classic)\n\n```bash\nvcpkg install directxtk\n```\n\nFeatures: `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.\n\nFor DLL usage (`x64-windows` default triplet), define `DIRECTX_TOOLKIT_IMPORT` in your consuming project. For static library usage, use `-static-md` triplet variants.\n\nCMakeLists.txt:\n\n```cmake\nfind_package(directxtk CONFIG REQUIRED)\ntarget_link_libraries(your_target PRIVATE Microsoft::DirectXTK)\n```\n\nSee the [d3d11game_vcpkg](https:\u002F\u002Fgithub.com\u002Fwalbourn\u002Fdirectx-vs-templates\u002Ftree\u002Fmain\u002Fd3d11game_vcpkg) template for a complete example.\n\n### NuGet\n\nUse `directxtk_desktop_win10` for Win32 desktop applications or `directxtk_uwp` for UWP apps.\n\n### Project Reference\n\nAdd the appropriate `.vcxproj` from the `DirectXTK\u002F` folder to your solution and add a project reference. Add the `DirectXTK\\Inc` directory to your Additional Include Directories.\n\n## Minimum Setup\n\nEvery DirectXTK application needs:\n\n1. A Direct3D 11 device\n2. A Direct3D immediate device context\n3. The application is responsible for the rendering, SwapChain management, and Present loop\n\n## API Reference\n\nThe public API is defined in the header files in the `Inc\u002F` directory. See the [reference overview](reference\u002Foverview.md) for a categorized summary of all classes and helpers.\n\nFull documentation for each class is available on the [GitHub wiki](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fwiki).\n\nAPI signatures are defined in the public headers under the `Inc\u002F` directory. Always consult those headers for the authoritative function signatures, parameters, and SAL annotations.\n\n## Key Concepts\n\n### Resource Ownership\n\nDirectXTK classes follow RAII principles. Most objects are created with `std::make_unique` and destroyed automatically. COM resources are managed with `Microsoft::WRL::ComPtr`.\n\n### Device-Dependent vs Device-Independent\n\nMost 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.\n\n### Thread Safety\n\nDirectXTK 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.\n\n## Namespace\n\nAll 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.\n\n```cpp\n#include \"SpriteBatch.h\"\n\n\u002F\u002F Usage:\nauto spriteBatch = std::make_unique\u003CDirectX::SpriteBatch>(context);\n```\n\n## Common Patterns\n\n### Drawing Sprites\n\n```cpp\n#include \"SpriteBatch.h\"\n#include \"WICTextureLoader.h\"\n\n\u002F\u002F Create\nauto spriteBatch = std::make_unique\u003CDirectX::SpriteBatch>(context);\nComPtr\u003CID3D11ShaderResourceView> texture;\nDirectX::CreateWICTextureFromFile(device, L\"cat.png\", nullptr, texture.GetAddressOf());\n\n\u002F\u002F Draw\nspriteBatch->Begin();\nspriteBatch->Draw(texture.Get(), DirectX::XMFLOAT2(100, 100));\nspriteBatch->End();\n```\n\n### Loading and Drawing a 3D Model\n\n```cpp\n#include \"Model.h\"\n#include \"CommonStates.h\"\n#include \"Effects.h\"\n\n\u002F\u002F Create\nauto states = std::make_unique\u003CDirectX::CommonStates>(device);\nauto fxFactory = std::make_unique\u003CDirectX::EffectFactory>(device);\nauto model = DirectX::Model::CreateFromSDKMESH(device, L\"ship.sdkmesh\", *fxFactory);\n\n\u002F\u002F Draw\nmodel->Draw(context, *states, world, view, projection);\n```\n\n### Drawing Geometric Primitives\n\n```cpp\n#include \"GeometricPrimitive.h\"\n\nauto sphere = DirectX::GeometricPrimitive::CreateSphere(context);\nsphere->Draw(world, view, projection);\n```\n\n### Using Effects\n\n```cpp\n#include \"Effects.h\"\n\nauto effect = std::make_unique\u003CDirectX::BasicEffect>(device);\neffect->SetWorld(world);\neffect->SetView(view);\neffect->SetProjection(projection);\neffect->SetTexture(textureSRV.Get());\neffect->Apply(context);\n```\n\n### Input Handling\n\n```cpp\n#include \"Keyboard.h\"\n#include \"Mouse.h\"\n#include \"GamePad.h\"\n\nauto keyboard = std::make_unique\u003CDirectX::Keyboard>();\nauto mouse = std::make_unique\u003CDirectX::Mouse>();\nauto gamePad = std::make_unique\u003CDirectX::GamePad>();\n\n\u002F\u002F In update loop\nauto kb = keyboard->GetState();\nif (kb.Escape)\n    PostQuitMessage(0);\n\nauto pad = gamePad->GetState(0);\nif (pad.IsConnected())\n{\n    if (pad.IsAPressed())\n        \u002F* jump *\u002F;\n}\n```\n\n### Audio\n\n```cpp\n#include \"Audio.h\"\n\n\u002F\u002F Create audio engine\nauto audioEngine = std::make_unique\u003CDirectX::AudioEngine>();\n\n\u002F\u002F Load and play a sound\nauto soundEffect = std::make_unique\u003CDirectX::SoundEffect>(audioEngine.get(), L\"explosion.wav\");\nsoundEffect->Play();\n\n\u002F\u002F Per-frame update\naudioEngine->Update();\n```\n\n## Getting Started Tutorial\n\nFor a full step-by-step walkthrough, see the [Getting Started](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fwiki\u002FGetting-Started) tutorial on the wiki.\n\n## Further Reading\n\n- [DirectXTK Wiki](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fwiki)\n- [DirectX Tool Kit for Audio](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fwiki\u002FAudio)\n- [SimpleMath documentation](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FDirectXTK\u002Fwiki\u002FSimpleMath)\n- [Project templates](https:\u002F\u002Fgithub.com\u002Fwalbourn\u002Fdirectx-vs-templates)\n","# DirectX Tool Kit for DirectX 11 — Usage Guide\n\n## Overview\n\nThe *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.\n\n- **Repository**: \u003Chttps:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK>\n- **Documentation**: \u003Chttps:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fwiki>\n- **NuGet Packages**: `directxtk_desktop_win10`, `directxtk_uwp`\n- **vcpkg Port**: `directxtk`\n\n## Integration Methods\n\n### vcpkg manifest-mode (Recommended)\n\nIn your `vcpkg.json` file, add the following:\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fraw.githubusercontent.com\u002Fmicrosoft\u002Fvcpkg-tool\u002Fmain\u002Fdocs\u002Fvcpkg.schema.json\",\n  \"dependencies\": [\n    \"directxmath\",\n    \"directxtk\"\n  ]\n}\n```\n\nIf using GameInput for the game input functionality, add the following:\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fraw.githubusercontent.com\u002Fmicrosoft\u002Fvcpkg-tool\u002Fmain\u002Fdocs\u002Fvcpkg.schema.json\",\n  \"dependencies\": [\n    \"directxmath\",\n    {\n      \"name\": \"directxtk\",\n      \"default-features\": false,\n      \"features\": [\n        \"gameinput\"\n      ]\n    }\n  ]\n}\n```\n\nIf using DirectX Tool Kit for Audio and GameInput, add the following:\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fraw.githubusercontent.com\u002Fmicrosoft\u002Fvcpkg-tool\u002Fmain\u002Fdocs\u002Fvcpkg.schema.json\",\n  \"dependencies\": [\n    \"directxmath\",\n    {\n      \"name\": \"directxtk\",\n      \"default-features\": false,\n      \"features\": [\n        \"gameinput\",\n        \"xaudio2-9\"\n      ]\n    }\n  ]\n}\n```\n\n### vcpkg (classic)\n\n```bash\nvcpkg install directxtk\n```\n\nFeatures: `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.\n\nFor DLL usage (`x64-windows` default triplet), define `DIRECTX_TOOLKIT_IMPORT` in your consuming project. For static library usage, use `-static-md` triplet variants.\n\nCMakeLists.txt:\n\n```cmake\nfind_package(directxtk CONFIG REQUIRED)\ntarget_link_libraries(your_target PRIVATE Microsoft::DirectXTK)\n```\n\nSee the [d3d11game_vcpkg](https:\u002F\u002Fgithub.com\u002Fwalbourn\u002Fdirectx-vs-templates\u002Ftree\u002Fmain\u002Fd3d11game_vcpkg) template for a complete example.\n\n### NuGet\n\nUse `directxtk_desktop_win10` for Win32 desktop applications or `directxtk_uwp` for UWP apps.\n\n### Project Reference\n\nAdd the appropriate `.vcxproj` from the `DirectXTK\u002F` folder to your solution and add a project reference. Add the `DirectXTK\\Inc` directory to your Additional Include Directories.\n\n## Minimum Setup\n\nEvery DirectXTK application needs:\n\n1. A Direct3D 11 device\n2. A Direct3D immediate device context\n3. The application is responsible for the rendering, SwapChain management, and Present loop\n\n## API Reference\n\nThe public API is defined in the header files in the `Inc\u002F` directory. See the [reference overview](reference\u002Foverview.md) for a categorized summary of all classes and helpers.\n\nFull documentation for each class is available on the [GitHub wiki](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fwiki).\n\nAPI signatures are defined in the public headers under the `Inc\u002F` directory. Always consult those headers for the authoritative function signatures, parameters, and SAL annotations.\n\n## Key Concepts\n\n### Resource Ownership\n\nDirectXTK classes follow RAII principles. Most objects are created with `std::make_unique` and destroyed automatically. COM resources are managed with `Microsoft::WRL::ComPtr`.\n\n### Device-Dependent vs Device-Independent\n\nMost 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.\n\n### Thread Safety\n\nDirectXTK 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.\n\n## Namespace\n\nAll 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.\n\n```cpp\n#include \"SpriteBatch.h\"\n\n\u002F\u002F Usage:\nauto spriteBatch = std::make_unique\u003CDirectX::SpriteBatch>(context);\n```\n\n## Common Patterns\n\n### Drawing Sprites\n\n```cpp\n#include \"SpriteBatch.h\"\n#include \"WICTextureLoader.h\"\n\n\u002F\u002F Create\nauto spriteBatch = std::make_unique\u003CDirectX::SpriteBatch>(context);\nComPtr\u003CID3D11ShaderResourceView> texture;\nDirectX::CreateWICTextureFromFile(device, L\"cat.png\", nullptr, texture.GetAddressOf());\n\n\u002F\u002F Draw\nspriteBatch->Begin();\nspriteBatch->Draw(texture.Get(), DirectX::XMFLOAT2(100, 100));\nspriteBatch->End();\n```\n\n### Loading and Drawing a 3D Model\n\n```cpp\n#include \"Model.h\"\n#include \"CommonStates.h\"\n#include \"Effects.h\"\n\n\u002F\u002F Create\nauto states = std::make_unique\u003CDirectX::CommonStates>(device);\nauto fxFactory = std::make_unique\u003CDirectX::EffectFactory>(device);\nauto model = DirectX::Model::CreateFromSDKMESH(device, L\"ship.sdkmesh\", *fxFactory);\n\n\u002F\u002F Draw\nmodel->Draw(context, *states, world, view, projection);\n```\n\n### Drawing Geometric Primitives\n\n```cpp\n#include \"GeometricPrimitive.h\"\n\nauto sphere = DirectX::GeometricPrimitive::CreateSphere(context);\nsphere->Draw(world, view, projection);\n```\n\n### Using Effects\n\n```cpp\n#include \"Effects.h\"\n\nauto effect = std::make_unique\u003CDirectX::BasicEffect>(device);\neffect->SetWorld(world);\neffect->SetView(view);\neffect->SetProjection(projection);\neffect->SetTexture(textureSRV.Get());\neffect->Apply(context);\n```\n\n### Input Handling\n\n```cpp\n#include \"Keyboard.h\"\n#include \"Mouse.h\"\n#include \"GamePad.h\"\n\nauto keyboard = std::make_unique\u003CDirectX::Keyboard>();\nauto mouse = std::make_unique\u003CDirectX::Mouse>();\nauto gamePad = std::make_unique\u003CDirectX::GamePad>();\n\n\u002F\u002F In update loop\nauto kb = keyboard->GetState();\nif (kb.Escape)\n    PostQuitMessage(0);\n\nauto pad = gamePad->GetState(0);\nif (pad.IsConnected())\n{\n    if (pad.IsAPressed())\n        \u002F* jump *\u002F;\n}\n```\n\n### Audio\n\n```cpp\n#include \"Audio.h\"\n\n\u002F\u002F Create audio engine\nauto audioEngine = std::make_unique\u003CDirectX::AudioEngine>();\n\n\u002F\u002F Load and play a sound\nauto soundEffect = std::make_unique\u003CDirectX::SoundEffect>(audioEngine.get(), L\"explosion.wav\");\nsoundEffect->Play();\n\n\u002F\u002F Per-frame update\naudioEngine->Update();\n```\n\n## Getting Started Tutorial\n\nFor a full step-by-step walkthrough, see the [Getting Started](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fwiki\u002FGetting-Started) tutorial on the wiki.\n\n## Further Reading\n\n- [DirectXTK Wiki](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fwiki)\n- [DirectX Tool Kit for Audio](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fwiki\u002FAudio)\n- [SimpleMath documentation](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FDirectXTK\u002Fwiki\u002FSimpleMath)\n- [Project templates](https:\u002F\u002Fgithub.com\u002Fwalbourn\u002Fdirectx-vs-templates)\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25,"version":26},"chuckw","1.0","main","861f3e7df437b50d1f28c964769329e9b23a50fb","skills\u002Fdirectxtk-usage",538,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK","https:\u002F\u002Fwalbourn.github.io\u002Fdirectxtk\u002F","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-04 05:52:16",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add microsoft\u002FDirectXTK --skill directxtk-usage",{"tool":43,"command":44},"bunx","bunx skills add microsoft\u002FDirectXTK --skill directxtk-usage",{"tool":46,"command":47},"pnpm","pnpm dlx skills add microsoft\u002FDirectXTK --skill directxtk-usage","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fblob\u002Fmain\u002Fskills\u002Fdirectxtk-usage\u002FSKILL.md",true,[51],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"reference\u002Foverview.md","REFERENCE","参考文档",7425,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fblob\u002Fmain\u002Fskills\u002Fdirectxtk-usage\u002Freference\u002Foverview.md",[58,65],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M74B3165NN8Z2HNYVHZV7PKH","directxtk-tutorial","Walk through the DirectX Tool Kit for DirectX 11 Getting Started tutorial step by step. Use this skill when asked to follow the tutorial, set up a new DirectX 11 project, or learn how to use DirectX Tool Kit from scratch.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fblob\u002Fmain\u002Fskills\u002Fdirectxtk-tutorial\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M74B2Y1V9FE3JCYZXYXRV0F9","release","Guide for performing the DirectX Tool Kit for DirectX 11 release process. Use this skill when asked to help with releasing a new version, publishing packages, or updating ports.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDirectXTK\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Frelease\u002FSKILL.md",[],[]]