Misc - microsoft/DirectX-SDK-Samples GitHub Wiki
Miscellaneous Samples
Autorun (June 2008)
The Autorun sample shows how to properly work with UAC and process elevation when building an autorun executable to start the installation process for a game and launch the game itself.
Use of Autorun is no longer recommended for security reasons.
CoreDetection (UPDATED)
This is the DirectX SDK's CoreDetection Windows desktop sample updated to eliminate all dependencies on legacy DirectX SDK content.
This sample also works around some known issues with the GetLogicalProcessorInformation
API. See KB932370.
See the Coding For Multiple Cores on Xbox 360 and Microsoft Windows article for more information.
For AMD, particularly the Ryzen CPUs, see GPUOpen.
For Intel, particularly the new Hybrid designs with P- and E-cores, see GameTechDev.
ContentExporter (UPDATED)
The latest version of this tool is available from GitHub.
D3D11InstallHelper (August 2009)
The D3D11InstallHelper sample is designed to simplify detection of the Direct3D 11 API, automatically install the system update if applicable to an end-user's computer, and to provide appropriate messages to the end-user on manual procedure if a newer Service Pack is required.
See Direct3D 11 deployment for game developers.
For modern Windows, DirectX 11 is always present.
DxDiagOutput (December 2002)
The DxDiagOutput sample shows how to use the DxDiag COM interface by enumerating every child container and enumerating the properties on each child container.
Note that this will trigger enabling the DirectPlay Windows Feature which is not present by default.
DxDiagReport (December 2002)
The DxDiagReport sample shows how to use the DxDiag COM interface by the instantiating a known set child container by name and enumerating the properties on each child container by name and stores this information in predefined structures.
DXInstall (December 2002)
DXInstall is an example of how to use DirectXSetup interfaces to install the DirectX subsystem and DirectX drivers. It shows how to use a callback function to present messages and get user input through a custom interface, in this case a simple modeless dialog box.
Use of the legacy DirectX End-User Runtime is strongly discouraged. See this blog post, so this sample has not been updated to build with modern tools and requires headers from the legacy DirectX SDK to build.
FirewallInstallHelper (December 2005)
The FirewallInstallHelper is a sample DLL that can be called from an installer to register an application with the Windows Firewall exception list.
See Windows Firewall for Game Developers.
GameStatisticsExample (March 2009)
This sample gets and sets game statistics viewed by the Windows 7 version of Game Explorer
Game Explorer was removed in Windows 10, so this sample will fail on newer versions of Windows.
GameuxInstallHelper (August 2009)
The GameuxInstallHelper is a DLL for use with install/setup programs to handle registration of Game Definition Files (GDF) with Windows Vista, Windows 7, and Windows 8 desktop games. For Windows 7 and Windows 8, the utility registers the GDFv2 schema data file using IGameExplorer2. For Windows Vista, the utility handles the additional manual steps required for registering a GDFv2 schema data file using the IGameExplorer interface.
See Windows Games Explorer for Game Developers.
Game Explorer was removed in Windows 10, so this sample is no longer applicable.
GDFTrace (UPDATED)
The Game Definition File Validator (GDFTrace.exe
) utility is a debugging aid for working with Game Definition File Editor (GDF) files for Windows Vista, Windows 7, Windows 8, and Windows 8.1 Preview. It is a command-line tool for validating the XML against the schema, displaying a 'human readable' summary, and generating validation warnings. It can be used either directly extracting the GDF from the containing EXE/DLL file, or against the 'raw' XML file.
Game Explorer was removed in Windows 10, so this sample is no longer applicable.
InstallOnDemand(December 2004)
This sample demonstrates two useful installation techniques for games: install-on-demand and background installation. The sample is broken up into features, and when it is installed, some features are advertised to reduce installation time. Then when the sample is run, advertised features can be installed in the background without interfering the user's experience.
ParentalControlTimeLimits(June 2007)
The Time Limits feature in Windows Parental Controls enables a parent to control the time their child spends on the computer. A game or application should be "time limit aware" and provide appropriate feedback to a user whose account is under time restrictions. This sample demonstrates how an application can obtain the Windows Parental Control Time Limit information for the current user.
PixPluginSample (July 2004)
The PIX Plugin Sample shows how to implement a plugin for the PIX for Windows tool, allowing you to define your own counters.
Legacy sample for PIX for Windows (DXSDK) version which no longer applies, so this sample has not been updated to build with modern tools and requires headers from the legacy DirectX SDK to build.
VideoMemory (UPDATED)
This is the DirectX SDK's VideoMemory sample updated to use the Windows SDK without any dependencies on legacy DirectX SDK content.