diff win32/directx/dxerr.d @ 1:4a9dcbd9e54f

-files of 0.13 beta -fixes so that it now compiles with the current dmd version
author marton@basel.hu
date Tue, 05 Apr 2011 20:44:01 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/win32/directx/dxerr.d	Tue Apr 05 20:44:01 2011 +0200
@@ -0,0 +1,55 @@
+/***********************************************************************\
+*                                 dxerr.d                               *
+*                                                                       *
+*                       Windows API header module                       *
+*                                                                       *
+*                       Placed into public domain                       *
+\***********************************************************************/
+module win32.directx.dxerr;
+
+import win32.windows;
+
+pragma(lib, "dxerr.lib");
+
+extern (Windows) {
+	CHAR*  DXGetErrorStringA(HRESULT hr);
+	WCHAR* DXGetErrorStringW(HRESULT hr);
+	CHAR*  DXGetErrorDescriptionA(HRESULT hr);
+	WCHAR* DXGetErrorDescriptionW(HRESULT hr);
+	HRESULT DXTraceA(CHAR* strFile, DWORD dwLine, HRESULT hr, CHAR* strMsg,
+	  BOOL bPopMsgBox);
+	HRESULT DXTraceW(CHAR* strFile, DWORD dwLine, HRESULT hr, WCHAR* strMsg,
+	  BOOL bPopMsgBox);
+}
+
+version (Unicode) {
+	alias DXGetErrorStringW DXGetErrorString;
+	alias DXGetErrorDescriptionW DXGetErrorDescription;
+	alias DXTraceW DXTrace;
+} else {
+	alias DXGetErrorStringA DXGetErrorString;
+	alias DXGetErrorDescriptionA DXGetErrorDescription;
+	alias DXTraceA DXTrace;
+}
+
+debug (dxerr) {
+	HRESULT DXTRACE_MSG(TCHAR* str) {
+		return DXTrace(__FILE__, __LINE__, 0, str, false);
+	}
+	HRESULT DXTRACE_ERR(TCHAR* str, HRESULT hr) {
+		return DXTrace(__FILE__, __LINE__, hr, str, false);
+	}
+	HRESULT DXTRACE_ERR_MSGBOX(TCHAR* str, HRESULT hr) {
+		return DXTrace(__FILE__, __LINE__, hr, str, true);
+	}
+} else {
+	HRESULT DXTRACE_MSG(TCHAR* str) {
+		return 0;
+	}
+	HRESULT DXTRACE_ERR(TCHAR* str, HRESULT hr) {
+		return hr;
+	}
+	HRESULT DXTRACE_ERR_MSGBOX(TCHAR* str, HRESULT hr) {
+		return hr;
+	}
+}
\ No newline at end of file