1 /*==========================================================================;
5 * Content: DirectX Error Library Include File
7 ****************************************************************************/
19 // Desc: Converts a DirectX 9 or earlier HRESULT to a string
21 // Args: HRESULT hr Can be any error code from
22 // D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW
24 // Return: Converted string
26 const char* WINAPI
DXGetErrorString9A(HRESULT hr
);
27 const WCHAR
* WINAPI
DXGetErrorString9W(HRESULT hr
);
30 #define DXGetErrorString9 DXGetErrorString9W
32 #define DXGetErrorString9 DXGetErrorString9A
37 // DXGetErrorDescription9
39 // Desc: Returns a string description of a DirectX 9 or earlier HRESULT
41 // Args: HRESULT hr Can be any error code from
42 // D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW
44 // Return: String description
46 const char* WINAPI
DXGetErrorDescription9A(HRESULT hr
);
47 const WCHAR
* WINAPI
DXGetErrorDescription9W(HRESULT hr
);
50 #define DXGetErrorDescription9 DXGetErrorDescription9W
52 #define DXGetErrorDescription9 DXGetErrorDescription9A
59 // Desc: Outputs a formatted error message to the debug stream
61 // Args: CHAR* strFile The current file, typically passed in using the
63 // DWORD dwLine The current line number, typically passed in using the
65 // HRESULT hr An HRESULT that will be traced to the debug stream.
66 // CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
67 // BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
69 // Return: The hr that was passed in.
71 HRESULT WINAPI
DXTraceA( const char* strFile
, DWORD dwLine
, HRESULT hr
, const char* strMsg
, BOOL bPopMsgBox
);
72 HRESULT WINAPI
DXTraceW( const char* strFile
, DWORD dwLine
, HRESULT hr
, const WCHAR
* strMsg
, BOOL bPopMsgBox
);
75 #define DXTrace DXTraceW
77 #define DXTrace DXTraceA
84 #if defined(DEBUG) | defined(_DEBUG)
85 #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
86 #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
87 #define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
89 #define DXTRACE_MSG(str) (0L)
90 #define DXTRACE_ERR(str,hr) (hr)
91 #define DXTRACE_ERR_MSGBOX(str,hr) (hr)