home *** CD-ROM | disk | FTP | other *** search
- /*
- Company: Sensaura Ltd
- Copyright: (C) 2000
-
- File Name: directx.h
- File Description: Header file for declaration of DirectX macros and error handling and support
- functions used by other application modules
- Author: Adam Philp
- Last Update: 04-JAN-00
-
- Target Compiler: Microsoft Visual C++ Version 5.0
- */
-
- #ifndef __directx_h // Sentry, use file only if it's not already included
- #define __directx_h
-
- /////////////////////// Macro definitions /////////////////////////////////////////////////////////
-
- #define TRY_DS(exp) { g_hrDS = exp; if (g_hrDS != DS_OK) { ReportDirectXError(g_strDSError, &g_hrDS, __FILE__, __LINE__); goto DS_ERROR; }}
- #define RETURN_DS(exp) { g_hrDS = exp; if (g_hrDS != DS_OK) { ReportDirectXError(g_strDSError, &g_hrDS, __FILE__, __LINE__); return false; } return true; }
- #define RELEASE(lpUnk) { if (lpUnk != NULL) { lpUnk->Release(); lpUnk = NULL; }}
-
- /////////////////////// Global constant declarations //////////////////////////////////////////////
-
- extern const char* g_strDSError; // DirectSound error message box caption string
-
- /////////////////////// Global variable declarations //////////////////////////////////////////////
-
- extern HRESULT g_hrDS; // DirectSound errors
- extern bool g_bReportDXErrors; // Set to false to suppress error message boxes
-
- /////////////////////// Global Function declarations //////////////////////////////////////////////
-
- void ReportDirectXError(LPCSTR, HRESULT*, LPCSTR pFile = NULL, int line = 0);
-
- #endif // End of sentry __directx_h
-