Microsoft has moved away from providing samples in SDKs for a number of reasons, but primarily to reduce the size of the standalone downloads and to minimize the size of the SDKs when included in other products (such as the Windows 8.x SDK being included with VS 2012 and VS 2013). The MSDN Code Gallery provides an online repository for samples, including both official Microsoft samples as well as community contributions. Here’s a list of the samples from the legacy DirectX SDK (June 2010) and their locations online if available.
Update: As of the Windows 10 SDK, official Windows samples are hosted on GitHub: Windows-universal-samples, Windows-classic-samples, Windows-driver-samples. Most of these republished legacy DirectX SDK samples can be found on GitHub as well.
The majority of these samples are Windows desktop applications. Where applicable, the table also notes similar samples for Windows Store apps on Windows 8.x.
|
Direct3D 11 Tutorials |
Tutorial01 - 07 Windows Store apps version: Tutorial08-10 Tutorial11-14 |
| AdaptiveTessellationCS40 FluidCS11 HDRToneMappingCS11 NBodyGravityCS11 OIT11 |
DirectCompute Graphics Win32 Samples Windows Store app samples: |
| BasicCompute11 ComputeShaderSort11 |
DirectCompute Basic Win32 Samples |
| BasicHLSL11 EmptyProject11 SimpleSample11 |
|
| BasicHLSL10 DynamicShaderLinkageFX11 FixedFuncEMU Instancing10 |
These samples make use of the Effects 11 (FX11) library. |
| BC6HBC7EncoderDecoder11 |
BC6H/BC7 DirectCompute Encoder Tool (Win32) Note this functionality is also present in the latest DirectXTex. |
| CascadedShadowMaps11 VarianceShadows11 |
Windows Store app samples: |
| DDSWithoutD3DX DDSWithoutD3DX11 |
An updated version of this sample is posted here. The DDSTextureLoader for Direct3D 11 from this sample is available in both DirectXTK and DirectXTex. |
| DynamicShaderLinkage11 | |
| MultithreadedRendering11 | |
| SimpleBezier11 SubD11 |
|
|
UVAtlas |
|
|
Misc Collision |
|
|
ContentExporter |
|
| CoreDetection |
Core Detection Sample (Win32) |
| D3D11InstallHelper |
Direct3D 11 Install Helper (Win32) |
| FirewallInstallHelper |
Windows Firewall Install Helper (Win32) |
| GameuxInstallHelper |
Gameux Install Helper (Win32) |
| VideoMemory |
DirectX Video Memory (Win32) |
|
XInput SimpleController |
XInput Samples (Win32) XInput 1.4 is only supported on Windows 8.x. XInput 1.3 is only available in the DirectX SDK. See XINPUT and Windows 8 for more information. Windows Store sample: |
|
XAudio2 XAudio2BasicSound |
XAudio2 Samples (Win32) XAudio 2.8 is only supported on Windows 8.x. XAudio 2.7 is only available in the DirectX SDK. See XAudio2 and Windows 8 for more information. Windows Store app samples: DirectXTK for Audio is also a sample of XAudio2 usage, and is demonstrated in the DirectX TK Simple Samples. |
|
DirectInput Customformat |
DirectInput Samples (Win32) Keyboard and Mouse samples are not included as use of DirectInput for these scenarios is not recommended. |
Windows 7.1 SDK Samples
| DirectShow |
A list of Windows 7.x SDK DirectShow samples is available on MSDN. |
| Windows Imaging Component
multimedia\wic\progressivedecoding
|
WIC Progressive Decode Win32 Sample |
Vendor Samples
| DepthOfField10.1 HDAO10.1 TransparencyAA10.1 ContactHardeningShadows11 |
AMD Radeon SDK (see the archive page) |
Retired Samples
| Direct3D9 |
The Direct3D 9 samples require D3DX9, so these remain available only in the DirectX SDK. |
| DirectDraw |
The DirectX SDK 8.1 was the last to contain the DirectDraw samples. |
| DirectMusic DirectPlay |
DirectX 9.0b (Summer 2003) was the last release of the DirectMusic or DirectPlay samples. |
| DirectSound |
The DirectX SDK (November 2007) release was the last time the DirectSound samples were shipped. |
| Managed DirectX 1.1 |
The DirectX SDK (August 2006) release was the last time the C# samples for legacy Managed DirectX 1.1 were shipped |
| XACT |
The DirectX SDK (June 2010) contains the last release of XACT and related samples. |
Related: DXUT for Win32 Desktop Update, Living without D3DX, DirectX SDK Tools Catalog
When clicking on the link provided for Tutorial11-14 (Effects Tutorial Win32 Sample), we get the following message:
"This item is not yet published.
If you are the owner of this project, please sign in with the appropriate account. "
@Wil – Sorry. Forgot to hit publish. Done.
OIT11 in DirectCompute Graphics Win32 Samples is broken.
It is compiled very well.
but some change happened in d3d11
so now D3D11 ERROR pumping.
D3D11 ERROR: ID3D11Device::CreateUnorderedAccessView: The format (0x1d, R8G8B8A8_UNORM_SRGB) cannot be used with a Typed Unordered Access View. [ STATE_CREATION ERROR #2097343: CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT]
First-chance exception at 0x76DD4598 in OIT11.exe: Microsoft C++ exception: _com_error at memory location 0x00EBEE20.
It need to be updated.
Thanks. Simple fix (applied to GitHub). In main.cpp:
bool CALLBACK IsD3D11DeviceAcceptable( const CD3D11EnumAdapterInfo *AdapterInfo, UINT Output, const CD3D11EnumDeviceInfo *DeviceInfo,DXGI_FORMAT BackBufferFormat, bool bWindowed, void* pUserContext )
{
if (BackBufferFormat == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB)
return false;
return true;
}
Not really impressed with the failure to host the older samples here. It makes it more difficult to discuss them in papers, etc.
What ‘older samples’ are you referring to? The problem with the Direct3D 9 and DIrect3D 10 samples is that they cannot be used without the legacy DirectX SDK because there’s no replacement for D3DX9 or D3DX10. If you are using those APIs, you really have to stick with using the legacy DirectX SDK in which case you can get the samples from there as well.
Thanks for these examples. Cannot express enough appreciation.
Thank you!
Thanks a lot!
I read this
“Keyboard and Mouse samples are not included as use of DirectInput for these scenarios is not recommended.”
Why DirectInput is not recommended for keyboard and mouse? Then what is recommended for them?
The DirectInput API dates back to Windows 9x/ME at which time it did use direct device access for low-latency mouse & keyboard. As of Windows 2000/XP, however, it is just a wrapper over Win32 input messages for keyboard & mouse. Since it’s just an emulation, you are better off using Win32 messages and APIs for mouse/keyboard directly. The only real use of DirectInput these days is to use legacy game controllers that use HID (rather than XID or GIP which is the Xbox Game Controller standard used by XInput and/or Windows.Gaming.Input).
As for what you should use, see the Keyboard and Mouse classes in DirectX Tool Kit.