home *** CD-ROM | disk | FTP | other *** search
/ Game Audio Programming / GameAudioProgramming.iso / Extras / Sensaura / SDK1.0 / data1.cab / Example_Files / ZoomFX / directx.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-13  |  1.6 KB  |  37 lines

  1. /*
  2.     Company:            Sensaura Ltd
  3.     Copyright:          (C) 2000
  4.  
  5.     File Name:            directx.h
  6.     File Description:    Header file for declaration of DirectX macros and error handling and support 
  7.                         functions used by other application modules
  8.     Author:                Adam Philp
  9.     Last Update:        04-JAN-00
  10.  
  11.     Target Compiler:    Microsoft Visual C++ Version 5.0
  12. */
  13.  
  14. #ifndef __directx_h                        // Sentry, use file only if it's not already included
  15. #define __directx_h
  16.  
  17. /////////////////////// Macro definitions /////////////////////////////////////////////////////////
  18.  
  19. #define TRY_DS(exp)        { g_hrDS = exp; if (g_hrDS != DS_OK) { ReportDirectXError(g_strDSError, &g_hrDS, __FILE__, __LINE__); goto DS_ERROR; }}
  20. #define RETURN_DS(exp)    { g_hrDS = exp; if (g_hrDS != DS_OK) { ReportDirectXError(g_strDSError, &g_hrDS, __FILE__, __LINE__); return false; } return true; }
  21. #define RELEASE(lpUnk)    { if (lpUnk != NULL) { lpUnk->Release(); lpUnk = NULL; }}
  22.  
  23. /////////////////////// Global constant declarations //////////////////////////////////////////////
  24.  
  25. extern const char*    g_strDSError;        // DirectSound error message box caption string
  26.  
  27. /////////////////////// Global variable declarations //////////////////////////////////////////////
  28.  
  29. extern HRESULT        g_hrDS;                // DirectSound errors
  30. extern bool            g_bReportDXErrors;    // Set to false to suppress error message boxes
  31.  
  32. ///////////////////////    Global Function declarations //////////////////////////////////////////////
  33.  
  34. void ReportDirectXError(LPCSTR, HRESULT*, LPCSTR pFile = NULL, int line = 0);
  35.  
  36. #endif                                    // End of sentry __directx_h
  37.