DirectX Tool Kit is now on CodePlex

DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing Direct3D 11 code for Metro style apps, Windows 8 Desktop, and Windows 7 'classic' applications in C++.


  • SpriteBatch - simple & efficient 2D sprite rendering
  • SpriteFont - bitmap based text rendering
  • Effects - set of built-in shaders for common rendering tasks
  • GeometricPrimitive - draws basic shapes such as cubes and spheres
  • CommonStates - factory providing commonly used D3D state objects
  • VertexTypes - structures for commonly used vertex data formats
  • DDSTextureLoader - light-weight DDS file texture loader
  • WICTextureLoader - WIC-based image file texture loader

DirectXTex is a shared source library for reading and writing DDS files, and performing various texture content processing operations including resizing, format conversion, mip-map generation, block compression for Direct3D runtime texture resources, and height-map to normal-map conversion. This library makes use of the Windows Image Component (WIC) APIs. It also includes a simple .TGA reader and writer since this image file format is commonly used for texture content processing pipelines, but is not currently supported by a built-in WIC codec.

Comments (17)

  1. Zheng Yang says:

    That's Awesome!!. Do we have any chance to contribute to the project. I wrote a book for Windows Phone 7 XNA, but still, I want to see native DirectX acts on further Windows Phone versions, I am pretty looking forward to get a chance to contribute my knowledge to community, especially for Windows Phone, that will help the platform more compelling compares to IOS and Android.

  2. ShawnHargreaves says:


    I think Chuck (my partner in crime building this stuff) wrote up our policy on 3rd party code contributions pretty well:

    "The DirectXTK contributors list will remain closed to ensure high-quality and focused feature set, but we are very interested in any bug-fixes, optimizations, additional features, or other community feedback on this library. Please use the Issue Tracker and feel free to attach code to the issue as needed. Note that any code contributed or released for the DirectXTK project is subject to the MS-PL."

  3. Thank you very much for this. I only wish that Codeplex was more like Github. Forking the project would be awesome!

  4. Zheng Yang says:

    Hi, Shawn,

    Still Thanks for your and Chuck's admirable hard work, the same, I will do help improving the platform from my side in the community.

  5. userxp2 says:

    can you please include couple of basic metro samples, using this lib. Would be helpful for beginners (new to metro or c++ directx)

  6. Groovebox says:

    Thank you very much! After learning so much about XNA for WP7, this is a blessing for developing WP8 and Windows RT apps 🙂

  7. userxp2 says:

    I posted this on codeplex as well, spritefont is causing exception during initialization

    spriteFont = std::unique_ptr<DirectX::SpriteFont>(new DirectX::SpriteFont(m_d3dDevice.Get(), L"Assets//arial.spritefont" ));

    I created arial.spritefont with below command

    "MakeSpriteFont.exe "Arial" arial.spritefont /FontSize:16"

  8. Zheng Yang says:

    Hi, Shawn,

    Is there any sample code for using the library? Thanks.

  9. Pooya.Eimandar says:

    Thanks man…that was helpful! Like others said, samples are really appreciated…

  10. Kastellanos Nikos says:

    Can it be build as a Windows Runtime Component?

  11. ShawnHargreaves says:

    > Can it be build as a Windows Runtime Component?

    DirectXTK can be used from a C++ WinRT app, but it is a native C++ API, not a WinRT interface.

  12. Kastellanos Nikos says:

    I see. My understanding was that you could build a Component as long as it doesn't publicly expose any not-WinRT types.  I'll dig this further.

  13. ShawnHargreaves says:

    > My understanding was that you could build a Component as long as it doesn't publicly expose any not-WinRT types

    Yes, you can write a component in any language as long as its public interface is entirely WinRT types.  But things like SpriteBatch and BasicEffect are not WinRT types, so if you build DirectXTK into a WINRT component, what would its public API be?  There'd be nothing to left to expose, which doesn't seem like a very interesting component 🙂

  14. JuniorDeveloper says:


    I need a help:

    in xna I use "LoadContent" to load a .png file to a Texture2D object.

    now in DirectxToolkit I don't know how to->

    1. load a png file  

    2. get it's width and heigth.

  15. JuniorDeveloper says:

    I need another help:

    In xna I create a texture2D and I can set color in it(by Texture2D.SetData<T>),

    how to set color into texture in DXTK?

  16. JuniorDeveloper says:

    I'm a windowsphone8 developer,but WIC is not supported on Windows Phone,

    is it means that I should give up .png files?

  17. ShawnHargreaves says:

    JuniorDeveloper:  the best place to get help with Windows Phone programming questions is the developer forums on

Skip to main content