1 /***********************************************************************\
2 *                                dxerr9.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                                                                       *
8 *                       Placed into public domain                       *
9 \***********************************************************************/
10 module win32.directx.dxerr9;
11 version(Windows):
12 
13 /*
14 	dxerr9.h - Header file for the DirectX 9 Error API
15 
16 	Written by Filip Navara <xnavara@volny.cz>
17 	Ported to D by James Pelcis <jpelcis@gmail.com>
18 
19 	This library is distributed in the hope that it will be useful,
20 	but WITHOUT ANY WARRANTY; without even the implied warranty of
21 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 
23 */
24 
25 private import win32.windef;
26 
27 extern (Windows) {
28 	char* DXGetErrorString9A(HRESULT);
29 	WCHAR* DXGetErrorString9W(HRESULT);
30 	char* DXGetErrorDescription9A(HRESULT);
31 	WCHAR* DXGetErrorDescription9W(HRESULT);
32 	HRESULT DXTraceA(char*, DWORD, HRESULT, char*, BOOL);
33 	HRESULT DXTraceW(char*, DWORD, HRESULT, WCHAR*, BOOL);
34 }
35 
36 version (Unicode) {
37 	alias DXGetErrorString9W DXGetErrorString9;
38 	alias DXGetErrorDescription9W DXGetErrorDescription9;
39 	alias DXTraceW DXTrace;
40 } else {
41 	alias DXGetErrorString9A DXGetErrorString9;
42 	alias DXGetErrorDescription9A DXGetErrorDescription9;
43 	alias DXTraceA DXTrace;
44 }
45 
46 debug (dxerr) {
47 	HRESULT DXTRACE_MSG(TCHAR* str) {
48 		return DXTrace(__FILE__, cast(DWORD)__LINE__, 0, str, FALSE);
49 	}
50 
51 	HRESULT DXTRACE_ERR(TCHAR* str, HRESULT hr) {
52 		return DXTrace(__FILE__, cast(DWORD)__LINE__, hr, str, FALSE);
53 	}
54 
55 	HRESULT DXTRACE_ERR_NOMSGBOX(TCHAR* str, HRESULT hr) {
56 		return DXTrace(__FILE__, cast(DWORD)__LINE__, hr, str, TRUE);
57 	}
58 } else {
59 	HRESULT DXTRACE_MSG(TCHAR* str) {
60 		return 0;
61 	}
62 
63 	HRESULT DXTRACE_ERR(TCHAR* str, HRESULT hr) {
64 		return hr;
65 	}
66 
67 	HRESULT DXTRACE_ERR_NOMSGBOX(TCHAR* str, HRESULT hr) {
68 		return hr;
69 	}
70 }