Using the DirectX Control Panel Application

You'll find the DirectX Control Panel Application in the Control Panel after installing the DirectX SDK. This applet has the usual DirectX icon. What it does for developers is nothing less than amazing. Once you begin using this tool, you'll wonder why Microsoft didn't include it in previous versions of the product.

Note For whatever reason, the DirectX Control Panel Application doesn't seem to install properly into the Windows XP System32 folder. If this problem occurs on your system, simply copy the DirectX.CPL file from the \DXSDK\bin\DXUtils folder to the \WINDOWS\system32 folder of your system. Restart your machine and the DirectX Control Panel Application should appear in the Control Panel. If all else fails, you can double-click the DirectX.CPL file from within Windows Explorer to start it.

When you initially open the DirectX Control Panel Application, you'll see the DirectX tab of the DirectX Properties dialog box. This tab tells you which version of DirectX your system is running and also provides access to a button found on every other tag—DxDiag. The DxDiag button will open the DirectX Diagnostic Tool that we discussed in section titled "Using the DXDIAG Utility" in Chapter 13.

The Direct3D tab contains the first developer-related information for this utility. Figure 15.1 shows the features of this tab. As you can see, it contains a lot of developer-oriented controls. The first control that you should become familiar with is the Debug Output Level slider. Interestingly enough, you can tell DirectX to tell you every woe it has or to shut up and process information. Most developers will want to turn off the output unless they're actually creating an application because it can become quite annoying. This slider appears on every tab so you can control the debug output of each DirectX feature individually.

operation of 3D drawing on your system.

Note Don't confuse the Direct3D tab with the DirectDraw tab. Use the Direct3D tab to control 3D drawing data and the DirectDraw tab to control 2D drawing data. In some cases, you'll want to change the settings on both tabs to ensure that you have the system set up correctly for the current task.

The next point of interest is the Debug/Retail settings. Every tab also has this feature. It enables you to switch between the debug and retail versions of DirectX so that you can test your application in both environments. Previous versions of DirectX forced the developer to use either the debug or the retail version of the product and didn't offer any means of tuning the debug output. As you can see, DirectX 8.1 is a vast improvement from the developer's perspective. Note that this feature only affects DirectX 8.0 and DirectX 8.1 libraries—it won't affect older libraries installed on your system.

The middle portion on the left side of the dialog box contains three check boxes that enable you to control performance. You'll use the Allow Hardware Acceleration feature most often. Clearing this option will force DirectX to use software emulation, even if hardware acceleration is available, so that you can measure worst-case performance for a system setup. These options might appear grayed out if your system doesn't provide support for the required feature.

The two debugging check boxes on the right side of the dialog box enable you to control how DirectX breaks within the debugger. Sometimes it's useful to see how your application affects DirectX so that you can change the way your application makes function calls and performs other tasks. This is one of the most useful features for developers who are trying to get DirectX to work in the managed environment because it can also help you tune your function, structure, and interface declarations.

The final area of interest on the Direct3D tab is the Drivers list box. This area contains a list of the drivers that affect Direct3D. However, unlike most driver lists, this one is formatted for developer use. You can use it to obtain information such as the GUID for the driver—a handy feature we could have used for the applications in previous chapters.

The DirectDraw tab shown in Figure 15.2 comes next. Remember that Direct3D and DirectDraw are combined. You won't find the usual Debug Output slider on this tab. However, some features are the same. For example, there's a Use Hardware Acceleration check box that you can use to force the driver to use software emulation. This option is separate from the Direct3D option.

igure 15.1: The Direct3D tab controls

Figure 15.2: The DirectDraw tab augments the information found in the Direct3D tab.

Some of the options are answers to developer requests of the past. For example, you couldn't use the Print Screen key to output screen data in the past. DirectX 8 provides this option so developers can grab screen shots with little trouble with the understanding that the Print Screen key can affect application execution.

Click Advanced Settings and you'll see a DirectDraw Advanced Settings dialog box that allows you to modify the normal operation of DirectX. For example, you can disable MMX or Accelerated Graphics Port (AGP) support to emulate certain system setups. You can also simulate a system lock failure and fine-tune emulation support.

The last three buttons display standard dialog boxes. For example, click Display Properties and you'll see the standard Display Properties dialog box. The last two options on this dialog tab display the modes that the display adapter supports and allow you to change the default refresh rate.

The DirectInput tab shown in Figure 15.3 contains the usual slider and Debug/Retail option. As you can see, this tab contains check boxes that determine which DirectInput features generate debug information. This is an important option because you might be interested in only one DirectInput area in your application. Getting debug information from all of the devices would prove confusing to say the least. In addition, an application might not even use the mouse or the joystick. Some developers might want to eliminate the keyboard if they're using it for debugging purposes. In short, these four options help you control the debugging environment with greater accuracy.

Figure 15.3: The Directlnput tab provides options for controlling which devices generate debug information.

Note The HID Support check box located on the Directlnput tab is for devices that provide this special form of support. Many mouse vendors provide this support and it's normally an option for game controllers. Look in the Human Interface Devices folder of the Device Manager to determine if your system has human interface device (HID) support. Generally, a HID provides additional input about the support it provides and could include special functionality, but you'll normally use it as a standard device in DirectX programming. DirectX 8.1 also provides the means for emulating the keyboard or mouse. You might wonder why this feature is important at first, only to discover how essential it is when you're attempting to debug the application. The emulation feature helps you keep the application environment separate from the debugging environment. The act of separating the two environments reduces a noticeable delay when stepping through an application in debug mode.

Click Gaming Options and you'll see the Game Controllers dialog box. This dialog box contains settings for adding, removing, and configuring game controllers on your system. The four controller types include joystick, game pad, flight yoke or stick, and racecar controller. You can also choose the number of controller axes and buttons, add support for a point-of-view (POV) control, and include rudders or pedals. If the controller fails to work as anticipated, you can troubleshoot it. There are also options for calibrating the device.

The DirectMusic tab is pretty mundane compared to the other tabs we've discussed so far. It contains the usual Debug Output Level slider and the Debug/Retail options. The main portion of this tab is filled with a list of music ports. However, unlike the Drivers list on the Direct3D tab, this one doesn't provide you with any driver information. In sum, this tab provides quick information and debugging selections but not much else.

The DirectPlay tab shown in Figure 15.4 is unusual in that it doesn't provide a Debug/Retail selection. Notice that this tab does provide a Break on Assert option that controls whether the application debugger will stop when it detects an assert error in the DirectPlay modules. Most developers will keep this option cleared unless the application is failing every time there's a network dialog. In general, you'll want to set the Debug Output Level slider to its maximum level first to see if the problem is found in the debugging messages that the module outputs. Breaking on assert can cause odd problems in the managed environment. In fact, you might find that it leaves the system in an unstable state that requires an eventual reboot.

igure 15.4: The DirectPlay tab lacks some of the features found on the other tabs.

The DirectSound tab also lacks the Debug/Retail option. However, it does contain the Debug Output Level slider. The Media Properties pushbutton displays the standard Sounds and Audio Devices Properties dialog box. The Sound Playback and Sound Recording list boxes contain a list of sound devices you can use for debugging. If you choose a specific device rather than the primary device option, the dialog box will also show the driver module information for the selected sound device.

Was this article helpful?

0 0

Post a comment