The DirectX Toolkit (aka DirectXTK) for Direct3D 11 introduced last year and made an official CodePlex project has continued to improve. The DirectXTK project provides ‘runtime’ utility shared-source C++ code to replace the deprecated D3DX library for Win32 desktop applications using Direct3D 11 (Windows 8, Windows 7, Windows Vista SP2+KB971644, and the Server equivalents) as well as Windows Store apps on Windows 8. This complements DirectXTex which provides shared-source C++ code for ‘build time’ texture processing that used to ship in D3DX, DirectXMath and Spherical Harmonics math which replace D3DXMath, and the D3DCompile API which replaced the once integrated HLSL compiler. For Win32 desktop applications, there’s also an Effects 11 to replace the FX library from D3DX9.
The original toolkit consisted of some key functionality based on the XNA Game Studio design: SpriteBatch, Effects, GeometricPrimitive along with some helper code (CommonStates, VertexTypes) and runtime texture loaders (DDSTextureLoader and WICTextureLoader). Shawn then added SpriteFont and support for Windows phone 8, and I added the ScreenGrab module to support the runtime creation of ‘screenshots’ from render targets. A fellow Microsoftie also contributed code for a geodesic sphere GeometricPrimitive as an alternative to the traditional UV-sphere.
The most recent additions to the library include
- PrimitiveBatch - simple and efficient way to draw dynamic geometry as a replacement for the Direct3D 9 "DrawUP" and "DrawIndexedUP" functions, ideal for debug geometry or on-the-fly procedural geometry generation.
- Improved GeometricPrimitive with support for proper winding order for both right-handed coordinates (the assumed default based on the XNA Game Studio conventions) and left-handed coordinates (typically used by DirectX C++ applications), as well as support for drawing them with custom effects.
- Model - This draws simple meshes loaded from Visual Studio 2012's built in Autodesk FBX exporter
.CMOfiles or the legacy DirectX SDK Samples Content Exporter
.SDKMESHfiles. This is currently limited to rigid models but we'll be working to add skinning support.
CodePlexGitHub site hosts the latest version of the library, documentation, discussion forums, bug reports, and feature requests. Developers can use Visual Studio 2012 or use Visual Studio 2010 with the standalone Windows 8.0 SDK.
We are also getting some samples using DirectXTK available on GitHub.
- SimpleSample - A Win32 desktop sample that demonstrates DirectXTK.
- SimpleSample - A Windows store app sample that demonstrates DirectXTK
- SimpleSample - A Windows phone 8 sample that demonstrates DirectXTK
- SimpleSample - A Win32 desktop sample that demonstrates DirectXTK in combination with DXUT.
- The Windows phone 8 version of MarbleMaze also makes use of DirectXTK
Update: DirectX Tool Kit is also hosted on GitHub.