diff win32/directx/dxerr9.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/dxerr9.d	Tue Apr 05 20:44:01 2011 +0200
@@ -0,0 +1,69 @@
+/***********************************************************************\
+*                                dxerr9.d                               *
+*                                                                       *
+*                       Windows API header module                       *
+*                                                                       *
+*                 Translated from MinGW Windows headers                 *
+*                                                                       *
+*                       Placed into public domain                       *
+\***********************************************************************/
+module win32.directx.dxerr9;
+
+/*
+	dxerr9.h - Header file for the DirectX 9 Error API
+
+	Written by Filip Navara <xnavara@volny.cz>
+	Ported to D by James Pelcis <jpelcis@gmail.com>
+
+	This library is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+*/
+
+private import win32.windef;
+
+extern (Windows) {
+	char* DXGetErrorString9A(HRESULT);
+	WCHAR* DXGetErrorString9W(HRESULT);
+	char* DXGetErrorDescription9A(HRESULT);
+	WCHAR* DXGetErrorDescription9W(HRESULT);
+	HRESULT DXTraceA(char*, DWORD, HRESULT, char*, BOOL);
+	HRESULT DXTraceW(char*, DWORD, HRESULT, WCHAR*, BOOL);
+}
+
+version (Unicode) {
+	alias DXGetErrorString9W DXGetErrorString9;
+	alias DXGetErrorDescription9W DXGetErrorDescription9;
+	alias DXTraceW DXTrace;
+} else {
+	alias DXGetErrorString9A DXGetErrorString9;
+	alias DXGetErrorDescription9A DXGetErrorDescription9;
+	alias DXTraceA DXTrace;
+}
+
+debug (dxerr) {
+	HRESULT DXTRACE_MSG(TCHAR* str) {
+		return DXTrace(__FILE__, cast(DWORD)__LINE__, 0, str, FALSE);
+	}
+
+	HRESULT DXTRACE_ERR(TCHAR* str, HRESULT hr) {
+		return DXTrace(__FILE__, cast(DWORD)__LINE__, hr, str, FALSE);
+	}
+
+	HRESULT DXTRACE_ERR_NOMSGBOX(TCHAR* str, HRESULT hr) {
+		return DXTrace(__FILE__, cast(DWORD)__LINE__, hr, str, TRUE);
+	}
+} else {
+	HRESULT DXTRACE_MSG(TCHAR* str) {
+		return 0;
+	}
+
+	HRESULT DXTRACE_ERR(TCHAR* str, HRESULT hr) {
+		return hr;
+	}
+
+	HRESULT DXTRACE_ERR_NOMSGBOX(TCHAR* str, HRESULT hr) {
+		return hr;
+	}
+}