1 /* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20 */ 21 #include "../../SDL_internal.h" 22 23 #ifndef SDL_directx_h_ 24 #define SDL_directx_h_ 25 26 /* Include all of the DirectX 8.0 headers and adds any necessary tweaks */ 27 28 #include "SDL_windows.h" 29 #include <mmsystem.h> 30 #ifndef WIN32 31 #define WIN32 32 #endif 33 #undef WINNT 34 35 /* Far pointers don't exist in 32-bit code */ 36 #ifndef FAR 37 #define FAR 38 #endif 39 40 /* Error codes not yet included in Win32 API header files */ 41 #ifndef MAKE_HRESULT 42 #define MAKE_HRESULT(sev,fac,code) \ 43 ((HRESULT)(((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code)))) 44 #endif 45 46 #ifndef S_OK 47 #define S_OK (HRESULT)0x00000000L 48 #endif 49 50 #ifndef SUCCEEDED 51 #define SUCCEEDED(x) ((HRESULT)(x) >= 0) 52 #endif 53 #ifndef FAILED 54 #define FAILED(x) ((HRESULT)(x)<0) 55 #endif 56 57 #ifndef E_FAIL 58 #define E_FAIL (HRESULT)0x80000008L 59 #endif 60 #ifndef E_NOINTERFACE 61 #define E_NOINTERFACE (HRESULT)0x80004002L 62 #endif 63 #ifndef E_OUTOFMEMORY 64 #define E_OUTOFMEMORY (HRESULT)0x8007000EL 65 #endif 66 #ifndef E_INVALIDARG 67 #define E_INVALIDARG (HRESULT)0x80070057L 68 #endif 69 #ifndef E_NOTIMPL 70 #define E_NOTIMPL (HRESULT)0x80004001L 71 #endif 72 #ifndef REGDB_E_CLASSNOTREG 73 #define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L 74 #endif 75 76 /* Severity codes */ 77 #ifndef SEVERITY_ERROR 78 #define SEVERITY_ERROR 1 79 #endif 80 81 /* Error facility codes */ 82 #ifndef FACILITY_WIN32 83 #define FACILITY_WIN32 7 84 #endif 85 86 #ifndef FIELD_OFFSET 87 #define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field)) 88 #endif 89 90 /* DirectX headers (if it isn't included, I haven't tested it yet) 91 */ 92 /* We need these defines to mark what version of DirectX API we use */ 93 #define DIRECTDRAW_VERSION 0x0700 94 #define DIRECTSOUND_VERSION 0x0800 95 #define DIRECTINPUT_VERSION 0x0800 /* Need version 7 for force feedback. Need version 8 so IDirectInput8_EnumDevices doesn't leak like a sieve... */ 96 97 #ifdef HAVE_DDRAW_H 98 #include <ddraw.h> 99 #endif 100 #ifdef HAVE_DSOUND_H 101 #include <dsound.h> 102 #endif 103 #ifdef HAVE_DINPUT_H 104 #include <dinput.h> 105 #else 106 typedef struct { int unused; } DIDEVICEINSTANCE; 107 #endif 108 109 #endif /* SDL_directx_h_ */ 110 111 /* vi: set ts=4 sw=4 expandtab: */ 112