146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef _directx_h 346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define _directx_h 446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* Include all of the DirectX 5.0 headers and adds any necessary tweaks */ 646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define WIN32_LEAN_AND_MEAN 846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include <windows.h> 946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include <mmsystem.h> 1046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef WIN32 1146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define WIN32 1246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 1346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#undef WINNT 1446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 1546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* Far pointers don't exist in 32-bit code */ 1646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef FAR 1746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define FAR 1846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 1946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 2046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* Error codes not yet included in Win32 API header files */ 2146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef MAKE_HRESULT 2246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define MAKE_HRESULT(sev,fac,code) \ 2346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner ((HRESULT)(((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code)))) 2446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 2546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 2646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef S_OK 2746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define S_OK (HRESULT)0x00000000L 2846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 2946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 3046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef SUCCEEDED 3146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define SUCCEEDED(x) ((HRESULT)(x) >= 0) 3246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 3346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef FAILED 3446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define FAILED(x) ((HRESULT)(x)<0) 3546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 3646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 3746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef E_FAIL 3846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define E_FAIL (HRESULT)0x80000008L 3946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 4046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef E_NOINTERFACE 4146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define E_NOINTERFACE (HRESULT)0x80004002L 4246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 4346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef E_OUTOFMEMORY 4446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define E_OUTOFMEMORY (HRESULT)0x8007000EL 4546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 4646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef E_INVALIDARG 4746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define E_INVALIDARG (HRESULT)0x80070057L 4846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 4946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef E_NOTIMPL 5046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define E_NOTIMPL (HRESULT)0x80004001L 5146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 5246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef REGDB_E_CLASSNOTREG 5346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L 5446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 5546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 5646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* Severity codes */ 5746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef SEVERITY_ERROR 5846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define SEVERITY_ERROR 1 5946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 6046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 6146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* Error facility codes */ 6246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef FACILITY_WIN32 6346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define FACILITY_WIN32 7 6446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 6546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 6646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifndef FIELD_OFFSET 6746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field)) 6846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 6946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 7046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* DirectX headers (if it isn't included, I haven't tested it yet) 7146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner */ 7246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner/* We need these defines to mark what version of DirectX API we use */ 7346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define DIRECTDRAW_VERSION 0x0700 7446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define DIRECTSOUND_VERSION 0x0500 7546be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define DIRECTINPUT_VERSION 0x0500 7646be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 7746be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#ifdef __GNUC__ 7846be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#define NONAMELESSUNION 7946be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif 8046be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include <ddraw.h> 8146be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include <dsound.h> 8246be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#include <dinput.h> 8346be48730333120a7b939116cef075e61c12c703David 'Digit' Turner 8446be48730333120a7b939116cef075e61c12c703David 'Digit' Turner#endif /* _directx_h */ 85