root/trunk/win32/directx/dxerr.d

Revision 306, 1.8 kB (checked in by smjg, 4 years ago)

fixed errors in dxerr; tweaks

Line 
1 /***********************************************************************\
2 *                                 dxerr.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                       Placed into public domain                       *
7 \***********************************************************************/
8 module win32.directx.dxerr;
9
10 import win32.windows;
11
12 pragma(lib, "dxerr.lib");
13
14 extern (Windows) {
15     CHAR*  DXGetErrorStringA(HRESULT hr);
16     WCHAR* DXGetErrorStringW(HRESULT hr);
17     CHAR*  DXGetErrorDescriptionA(HRESULT hr);
18     WCHAR* DXGetErrorDescriptionW(HRESULT hr);
19     HRESULT DXTraceA(CHAR* strFile, DWORD dwLine, HRESULT hr, CHAR* strMsg,
20       BOOL bPopMsgBox);
21     HRESULT DXTraceW(CHAR* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg,
22       BOOL bPopMsgBox);
23 }
24
25 version (Unicode) {
26     alias DXGetErrorStringW DXGetErrorString;
27     alias DXGetErrorDescriptionW DXGetErrorDescription;
28     alias DXTraceW DXTrace;
29 } else {
30     alias DXGetErrorStringA DXGetErrorString;
31     alias DXGetErrorDescriptionA DXGetErrorDescription;
32     alias DXTraceA DXTrace;
33 }
34
35 debug (dxerr) {
36     HRESULT DXTRACE_MSG(TCHAR* str) {
37         return DXTrace(__FILE__, __LINE__, 0, str, false);
38     }
39     HRESULT DXTRACE_ERR(TCHAR* str, HRESULT hr) {
40         return DXTrace(__FILE__, __LINE__, hr, str, false);
41     }
42     HRESULT DXTRACE_ERR_MSGBOX(TCHAR* str, HRESULT hr) {
43         return DXTrace(__FILE__, __LINE__, hr, str, true);
44     }
45 } else {
46     HRESULT DXTRACE_MSG(TCHAR* str) {
47         return 0;
48     }
49     HRESULT DXTRACE_ERR(TCHAR* str, HRESULT hr) {
50         return hr;
51     }
52     HRESULT DXTRACE_ERR_MSGBOX(TCHAR* str, HRESULT hr) {
53         return hr;
54     }
55 }
Note: See TracBrowser for help on using the browser.