1 /***********************************************************************\
2 *                                dxerr8.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.dxerr8;
11 version(Windows):
12 
13 /*
14 	dxerr8.d - Header file for the DirectX 8 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 private import win32.windef;
25 
26 extern (Windows) {
27 	char* DXGetErrorString8A (HRESULT);
28 	WCHAR* DXGetErrorString8W (HRESULT);
29 	char* DXGetErrorDescription8A (HRESULT);
30 	WCHAR* DXGetErrorDescription8W (HRESULT);
31 	HRESULT DXTraceA (char*, DWORD, HRESULT, char*, BOOL);
32 	HRESULT DXTraceW (char*, DWORD, HRESULT, WCHAR*, BOOL);
33 }
34 
35 version (Unicode) {
36 	alias DXGetErrorString8W DXGetErrorString8;
37 	alias DXGetErrorDescription8W DXGetErrorDescription8;
38 	alias DXTraceW DXTrace;
39 } else {
40 	alias DXGetErrorString8A DXGetErrorString8;
41 	alias DXGetErrorDescription8A DXGetErrorDescription8;
42 	alias DXTraceA DXTrace;
43 }
44 
45 debug (dxerr) {
46 	HRESULT DXTRACE_MSG(TCHAR* str) {
47 		return DXTrace(__FILE__, __LINE__, 0, str, FALSE);
48 	}
49 
50 	HRESULT DXTRACE_ERR(TCHAR* str, HRESULT hr) {
51 		return DXTrace(__FILE__, __LINE__, hr, str, TRUE);
52 	}
53 
54 	HRESULT DXTRACE_ERR_NOMSGBOX (WCHAR* str, HRESULT hr) {
55 		return DXTrace(__FILE__, __LINE__, hr, str, FALSE);
56 	}
57 } else {
58 	HRESULT DXTRACE_MSG(TCHAR* str) {
59 		return 0;
60 	}
61 
62 	HRESULT DXTRACE_ERR(TCHAR* str, HRESULT hr) {
63 		return hr;
64 	}
65 
66 	HRESULT DXTRACE_ERR_NOMSGBOX(TCHAR* str, HRESULT hr) {
67 		return hr;
68 	}
69 }