Merge branch 'mesa_7_6_branch' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa
[mesa.git] / src / mesa / drivers / windows / gldirect / dx7 / gld_dxerr7.h
1 /*==========================================================================;
2 *
3 *
4 * File: dxerr8.h
5 * Content: DirectX Error Library Include File
6 *
7 ****************************************************************************/
8
9 #ifndef _GLD_DXERR7_H_
10 #define _GLD_DXERR7_H_
11
12
13 #include <d3d.h>
14
15 //
16 // DXGetErrorString8
17 //
18 // Desc: Converts an DirectX HRESULT to a string
19 //
20 // Args: HRESULT hr Can be any error code from
21 // DPLAY D3D8 D3DX8 DMUSIC DSOUND
22 //
23 // Return: Converted string
24 //
25 const char* __stdcall DXGetErrorString8A(HRESULT hr);
26 const WCHAR* __stdcall DXGetErrorString8W(HRESULT hr);
27
28 #ifdef UNICODE
29 #define DXGetErrorString8 DXGetErrorString8W
30 #else
31 #define DXGetErrorString8 DXGetErrorString8A
32 #endif
33
34
35 //
36 // DXTrace
37 //
38 // Desc: Outputs a formatted error message to the debug stream
39 //
40 // Args: CHAR* strFile The current file, typically passed in using the
41 // __FILE__ macro.
42 // DWORD dwLine The current line number, typically passed in using the
43 // __LINE__ macro.
44 // HRESULT hr An HRESULT that will be traced to the debug stream.
45 // CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
46 // BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
47 //
48 // Return: The hr that was passed in.
49 //
50 //HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox = FALSE );
51 //HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox = FALSE );
52 HRESULT __stdcall DXTraceA( char* strFile, DWORD dwLine, HRESULT hr, char* strMsg, BOOL bPopMsgBox);
53 HRESULT __stdcall DXTraceW( char* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg, BOOL bPopMsgBox);
54
55 #ifdef UNICODE
56 #define DXTrace DXTraceW
57 #else
58 #define DXTrace DXTraceA
59 #endif
60
61
62 //
63 // Helper macros
64 //
65 #if defined(DEBUG) | defined(_DEBUG)
66 #define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
67 #define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
68 #define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
69 #else
70 #define DXTRACE_MSG(str) (0L)
71 #define DXTRACE_ERR(str,hr) (hr)
72 #define DXTRACE_ERR_NOMSGBOX(str,hr) (hr)
73 #endif
74
75
76 #endif
77