Debugging Directx Applications

Created by Jijith Nadumuri at 28 Apr 2010 12:07 and updated at 28 Apr 2010 12:46

Debugging DirectX Applications

Debug vs. Retail DLLs

The Microsoft DirectX SDK installation program provides the option of installing either debug or retail builds of the DirectX dynamic-link libraries (DLLs).

When you develop software in C++, it is best to install the debug versions of the DLLs. This option installs both debug and retail DLLs on your system. The retail option installs only the retail DLLs. The debug DLLs have additional-code that validates internal data structures and output debug error messages, using the Microsoft Win32 OutputDebugString function, while your program is executing. When an error occurs, the debug output gives you a more detailed description of the problem. The debug DLLs execute more slowly than the retail DLLs but are much more useful for debugging an application.

Error Handling Functions and Macros in DirectX8

The following functions and macros are included in the DirectX error handling utility library.

  • DXGetErrorDescription9: Returns a string that describes the HRESULT code
  • DXGetErrorString9: Returns the name associated with a Microsoft DirectX error code.
  • DXTrace: Displays a message-box, and passes the error-code to DXGetErrorString9

The following macros simplify using the DXTrace function.

  • DXTRACE_ERR: Passes error information to the debugger
  • DXTRACE_ERR_MSGBOX: Displays a message box with error information
  • DXTRACE_MSG: Passes a string to the debugger.

Share:- Facebook

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License