Official agent skill

Directxtk12 Usage

by microsoft in microsoft/DirectXTK12

Guide for integrating DirectX Tool Kit for DirectX 12 into new projects and understanding the library's API surface.

OfficialMITAuto-check passed

Install Directxtk12 Usage

skills CLI
$ npx skills add microsoft/DirectXTK12 --skill directxtk12-usage -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/DirectXTK12 directxtk12-usage --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/DirectXTK12.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/directxtk12-usage .claude/skills/directxtk12-usage && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
directxtk12-usage
GitHub stars
1.8k
Token cost
~2.2k tokens
SKILL.md length
608 words
Files
2
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Guide for integrating DirectX Tool Kit for DirectX 12 into new projects and understanding the library's API surface.

  • Works in 6 steps: Create a ID3D12Device. → Create a GraphicsMemory instance (one… → Create a DescriptorHeap for SRV/CBV/UAV… → …
  • Asked about how to use DirectXTK12
  • SKILL.md covers Overview, Integration Methods, Minimum Requirements and Getting Started, plus 6 more sections
  • Reaches raw.githubusercontent.com

What it does

Directxtk12 Usage is an agent skill from microsoft/DirectXTK12, published by the product's own GitHub organization. Guide for integrating DirectX Tool Kit for DirectX 12 into new projects and understanding the library's API surface. Use this skill when asked about how to use DirectXTK12, set up a new project, or get an overview of available classes and functionality.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `reference/overview.md`).

It works with Windows. The repository describes itself as: The DirectX Tool Kit (aka DirectXTK12) is a collection of helper classes for writing DirectX 12 code in C++. The licence is MIT.

When your agent uses it

  • Asked about how to use DirectXTK12
  • Set up a new project
  • Get an overview of available classes and functionality

Example prompts

  • “/directxtk12-usage”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Create a ID3D12Device.
  2. Create a GraphicsMemory instance (one per device).
  3. Create a DescriptorHeap for SRV/CBV/UAV descriptors.
  4. Use ResourceUploadBatch to upload textures and static buffers to the GPU.
  5. Create rendering helpers (e.g., SpriteBatch, Effects, Model) with the appropriate pipeline state.
  6. Each frame, call GraphicsMemory::Commit after executing command lists.

What it can do on your machine

Read from SKILL.md and the folder at commit 2f7b07a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are cpp, json, bash and cmake).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • raw.githubusercontent.com

    Also links to:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Directxtk12 Usage loads about 2.2k tokens when it runs. Until then it costs about 68 tokens; SKILL.md has 608 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~68
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/DirectXTK12 at commit 2f7b07a, republished under its MIT licence (© microsoft). 608 words, ~2,172 tokens.

Download SKILL.mdSave it as .claude/skills/directxtk12-usage/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
directxtk12-usage
description
Guide for integrating DirectX Tool Kit for DirectX 12 into new projects and understanding the library's API surface. Use this skill when asked about how to use DirectXTK12, set up a new project, or get an overview of available classes and functionality.
license
MIT
metadata.author
chuckw
metadata.version
1.0

DirectX Tool Kit for DirectX 12 — Usage Guide

Overview

The DirectX Tool Kit for DirectX 12 (DirectXTK12) is a collection of helper classes for writing Direct3D 12 C++ code for Win32 desktop applications (Windows 10+), Xbox Series X|S, Xbox One, and Universal Windows Platform (UWP) apps.

Integration Methods

In your vcpkg.json file, add the following:

json
{
  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
  "dependencies": [
    "directx-headers",
    "directxmath",
    "directxtk12"
  ]
}

If using GameInput for the game input functionality, add the following:

json
{
  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
  "dependencies": [
    "directx-headers",
    "directxmath",
    {
      "name": "directxtk12",
      "default-features": false,
      "features": [
        "gameinput"
      ]
    }
  ]
}

If using DirectX Tool Kit for Audio and GameInput, add the following:

json
{
  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
  "dependencies": [
    "directx-headers",
    "directxmath",
    {
      "name": "directxtk12",
      "default-features": false,
      "features": [
        "gameinput",
        "xaudio2-9"
      ]
    }
  ]
}
vcpkg (classic)
bash
vcpkg install directxtk12

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:

cmake
find_package(directxtk12 CONFIG REQUIRED)
target_link_libraries(your_target PRIVATE Microsoft::DirectXTK12)

Use the d3d12game_vcpkg template as a starting point.

NuGet

Use directxtk12_desktop_win10 for Win32 desktop applications or directxtk12_uwp for UWP apps.

Project Reference

Add the appropriate .vcxproj from the DirectXTK12/ folder to your solution and add a project reference. Add the DirectXTK12\Inc directory to your Additional Include Directories.

Minimum Requirements

  • Windows 10 May 2020 Update SDK (19041) or later
  • Visual Studio 2022, Visual Studio 2026, clang for Windows v12+, or MinGW 12.2
  • Direct3D Feature Level 11.0 or higher

Getting Started

For a full step-by-step walkthrough, see the Getting Started tutorial on the wiki.

A minimal initialization sequence:

  1. Create a ID3D12Device.
  2. Create a GraphicsMemory instance (one per device).
  3. Create a DescriptorHeap for SRV/CBV/UAV descriptors.
  4. Use ResourceUploadBatch to upload textures and static buffers to the GPU.
  5. Create rendering helpers (e.g., SpriteBatch, Effects, Model) with the appropriate pipeline state.
  6. Each frame, call GraphicsMemory::Commit after executing command lists.

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

Show full SKILL.md (253 more words)Show less
Resource Ownership

DirectXTK12 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 DirectXTK12 objects are device-dependent — they are created with a ID3D12Device* and must be recreated if the device is lost. Plan your resource management accordingly.

Thread Safety

DirectXTK12 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.

Key Concepts for DirectX 12 Users

  • Pipeline State Objects (PSOs): Unlike the DX11 version, DX12 requires explicit PSO management. Use EffectPipelineStateDescription and RenderTargetState to configure PSOs for effects and rendering helpers.
  • Descriptor Heaps: Use DescriptorHeap to manage shader-visible descriptor heaps. Most rendering classes require descriptor heap indices at draw time.
  • Resource Upload: GPU resources must be uploaded explicitly. ResourceUploadBatch batches uploads into a single command list for efficiency.
  • Graphics Memory: GraphicsMemory manages per-frame dynamic allocations (constant buffers, dynamic vertex/index buffers). Call Commit once per frame.

Namespace

All classes and functions reside in the DirectX namespace. Headers that contain Direct3D 12-specific types use inline namespace DX12 to avoid conflicts when both DX11 and DX12 toolkits are linked together.

cpp
#include "SpriteBatch.h"

// Usage:
auto spriteBatch = std::make_unique<DirectX::SpriteBatch>(device, ...);

Common Patterns

Creating an Effect
cpp
#include "Effects.h"
#include "EffectPipelineStateDescription.h"
#include "RenderTargetState.h"

RenderTargetState rtState(DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_D32_FLOAT);

EffectPipelineStateDescription pd(
    &VertexPositionNormalTexture::InputLayout,
    CommonStates::Opaque,
    CommonStates::DepthDefault,
    CommonStates::CullCounterClockwise,
    rtState);

auto effect = std::make_unique<BasicEffect>(device, EffectFlags::Lighting | EffectFlags::Texture, pd);
Loading and Drawing a Model
cpp
#include "Model.h"

auto model = Model::CreateFromSDKMESH(device, L"mymodel.sdkmesh");

// Upload resources
ResourceUploadBatch upload(device);
upload.Begin();
model->LoadStaticBuffers(device, upload);
upload.End(commandQueue).wait();

// Draw (simplified — see wiki for full parameter details)
model->Draw(commandList, ...);
Texture Loading
cpp
#include "DDSTextureLoader.h"
#include "ResourceUploadBatch.h"
#include "DescriptorHeap.h"

ResourceUploadBatch upload(device);
upload.Begin();

Microsoft::WRL::ComPtr<ID3D12Resource> texture;
CreateDDSTextureFromFile(device, upload, L"texture.dds", texture.ReleaseAndGetAddressOf());

upload.End(commandQueue).wait();
Input Handling
cpp
#include "Keyboard.h"
#include "Mouse.h"
#include "GamePad.h"

auto keyboard = std::make_unique<DirectX::Keyboard>();
auto mouse = std::make_unique<DirectX::Mouse>();
auto gamePad = std::make_unique<DirectX::GamePad>();

// In update loop
auto kb = keyboard->GetState();
if (kb.Escape)
    PostQuitMessage(0);

auto pad = gamePad->GetState(0);
if (pad.IsConnected())
{
    if (pad.IsAPressed())
        /* jump */;
}
Audio
cpp
#include "Audio.h"

// Create audio engine
auto audioEngine = std::make_unique<DirectX::AudioEngine>();

// Load and play a sound
auto soundEffect = std::make_unique<DirectX::SoundEffect>(audioEngine.get(), L"explosion.wav");
soundEffect->Play();

// Per-frame update
audioEngine->Update();

Note: Code examples above are simplified for clarity. Consult the wiki tutorials and public headers in Inc/ for complete working code with all required parameters.

Further Reading

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/directxtk12-usage of microsoft/DirectXTK12.

  • SKILL.md
  • reference/overview.md

Open the folder on GitHubat commit 2f7b07a

Compare with similar skills

Directxtk12 Usage next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Directxtk12 Usage compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Directxtk12 Usage this skillmicrosoft/DirectXTK121.8k—~2.2kAutomated safety check: PassMIT
Translation Diff ExportDevolutions/UniGetUI26k—~1.1kAutomated safety check: PassMIT
Translation Diff ImportDevolutions/UniGetUI26k—~750Automated safety check: PassMIT
Translation Diff TranslateDevolutions/UniGetUI26k—~934Automated safety check: PassMIT
Translation ReviewDevolutions/UniGetUI26k—~1.3kAutomated safety check: PassMIT
Translation Source SyncDevolutions/UniGetUI26k—~1.2kAutomated safety check: PassMIT

Similar skills

  • Translation Diff Export

    Devolutions/UniGetUI

    Compares UniGetUI JSON locale files against English, identifies untranslated or source-changed keys, and generates patch, reference, and handoff files for a target language.

    26k GitHub stars~1.1k tokensUpdated yesterday
    Writing & ContentAuto-check passed
  • Translation Diff Import

    Devolutions/UniGetUI

    Merges translated key-value pairs from a UniGetUI JSON localization patch back into the full language file and validates the merged result.

    26k GitHub stars~750 tokensUpdated yesterday
    Writing & ContentAuto-check passed
  • Translation Diff Translate

    Devolutions/UniGetUI

    Translates a sparse UniGetUI JSON language patch, writes completed entries into the working copy, preserves placeholders and terminology, and prepares the patch for merge-back.

    26k GitHub stars~934 tokensUpdated yesterday
    Writing & ContentAuto-check passed
  • Translation Review

    Devolutions/UniGetUI

    Reviews UniGetUI .json language files for localization quality, detects parity issues, English-equal entries, wrong-script content, and cross-language outliers, then generates a dataset for…

    26k GitHub stars~1.3k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Translation Source Sync

    Devolutions/UniGetUI

    Synchronizes the UniGetUI English language file with source-code usage, identifies missing translation keys, removes unused entries, reports localization drift, and can reorder locale files to match…

    26k GitHub stars~1.2k tokensUpdated yesterday
    Writing & ContentAuto-check passed
  • Winui App

    LanceMcCarthy/DevOpsExamples

    Bootstrap, develop, and design modern WinUI 3 desktop applications with C and the Windows App SDK using official Microsoft guidance, WinUI Gallery patterns, Windows App SDK samples, and…

    172 GitHub starsUsed in 1 repo~2.8k tokens
    DevOps & CloudAuto-check passed

More from microsoft/DirectXTK12

  • Directxtk12 Tutorial

    microsoft/DirectXTK12

    Official

    Walk through the DirectX Tool Kit for DirectX 12 Getting Started tutorial step by step.

    1.8k GitHub stars~472 tokensUpdated yesterday
    Auto-check passed
  • Release

    microsoft/DirectXTK12

    Official

    Guide for performing the DirectX Tool Kit for DirectX 12 release process.

    1.8k GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Directxtk12 Usage

What does Directxtk12 Usage do?

Guide for integrating DirectX Tool Kit for DirectX 12 into new projects and understanding the library's API surface. Directxtk12 Usage is an agent skill from microsoft/DirectXTK12, published by the product's own GitHub organization. Guide for integrating DirectX Tool Kit for DirectX 12 into new projects and understanding the library's API surface.

When should I use Directxtk12 Usage?

Directxtk12 Usage fits situations like: asked about how to use DirectXTK12; set up a new project; get an overview of available classes and functionality.

How do I install Directxtk12 Usage in Claude Code?

Run `npx skills add microsoft/DirectXTK12 --skill directxtk12-usage -a claude-code`. Or copy the skill folder (skills/directxtk12-usage in microsoft/DirectXTK12) into .claude/skills/directxtk12-usage in your project. Claude Code loads it when a task matches its description.

How do I install Directxtk12 Usage in Codex?

Run `npx skills add microsoft/DirectXTK12 --skill directxtk12-usage -a codex`. Or copy the skill folder (skills/directxtk12-usage in microsoft/DirectXTK12) into .agents/skills/directxtk12-usage in your project. Codex loads it when a task matches its description.

Can I use Directxtk12 Usage in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/DirectXTK12 --skill directxtk12-usage -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/directxtk12-usage, .gemini/skills/directxtk12-usage, .github/skills/directxtk12-usage and .opencode/skills/directxtk12-usage in your project.

What does Directxtk12 Usage need to run?

SKILL.md names no scripts, command-line tools or credentials: Directxtk12 Usage is instructions for the agent only.

Does Directxtk12 Usage access the network?

SKILL.md names 2 domains. In commands or code: raw.githubusercontent.com; the agent is likely to contact it when it follows the instructions. As links in the text: github.com. This is read from the text; nothing was executed.

Is Directxtk12 Usage safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Directxtk12 Usage use?

Directxtk12 Usage is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Directxtk12 Usage use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Directxtk12 Usage?

Skills that share tags, products or a category with Directxtk12 Usage: Translation Diff Export (Devolutions/UniGetUI, 26k stars), Translation Diff Import (Devolutions/UniGetUI, 26k stars), Translation Diff Translate (Devolutions/UniGetUI, 26k stars) and Translation Review (Devolutions/UniGetUI, 26k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Directxtk12 Usage?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/DirectXTK12, which has 1,757 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 6, 2026.

Source: microsoft/DirectXTK12 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.