?/TD> |
Microsoft DirectX 9.0 |
This sample shows how the DIDevImage framework provided with the samples, located in the (SDK root)\samples\C++\Common folder, can be used to create a custom device configuration interface.
DIDevImage framework handles issues such as bookkeeping involved with bitmaps, ToolTips, and image scaling. If extra functionality is needed, you can modify the source code for the DIDevImage framework at (SDK root)\samples\cpp\common\src\didevimg.cpp.
Source: (SDK root)\Samples\Multimedia\DirectInput\DeviceView
Executable: (SDK root)\Samples\Multimedia\DirectInput\Bin\DeviceView.exe
When you run the application, it will display a tab for each Microsoft?DirectInput?device on your system. For each device, you scroll through multiple pages by entering a value for the desired page or by using the scroll arrows.
To select a device object, click the mouse on the name of the device or activate the device object. This will highlight the name of the current device object and display the object's image overlay (if available).
To hide unmapped objects, select the Hide Unmapped check box.
This sample is built on the DIDevImage framework, which handles the device image loading, scaling, and rendering. To use the framework:
The CIDevImage framework has some optimizations for quick renderings, but your application should not call the Render method for each frame. Instead, try to call the framework's Render method only when the device image changes due to user input.
Read the inline comments included with the CIDevImage framework source code for information about using some of the more advanced features, such as transparent backgrounds for Microsoft Direct3D?surfaces.
It is not necessary to create a device configuration user interface (UI). DirectInput provides a UI that can be customized and is called by the IDirectInput8::ConfigureDevices method. The source code for the default UI is also provided with this software development kit (SDK) (samples\cpp\DirectInput\diconfig). The DirectInput UI, as well as the DIDevImage framework UI, call the IDirectInputDevice8::GetImageInfo method to retrieve the device images.