Path: blob/master/thirdparty/sdl/core/windows/SDL_directx.h
9905 views
/*1Simple DirectMedia Layer2Copyright (C) 1997-2025 Sam Lantinga <[email protected]>34This software is provided 'as-is', without any express or implied5warranty. In no event will the authors be held liable for any damages6arising from the use of this software.78Permission is granted to anyone to use this software for any purpose,9including commercial applications, and to alter it and redistribute it10freely, subject to the following restrictions:11121. The origin of this software must not be misrepresented; you must not13claim that you wrote the original software. If you use this software14in a product, an acknowledgment in the product documentation would be15appreciated but is not required.162. Altered source versions must be plainly marked as such, and must not be17misrepresented as being the original software.183. This notice may not be removed or altered from any source distribution.19*/20#include "SDL_internal.h"2122#ifndef SDL_directx_h_23#define SDL_directx_h_2425// Include all of the DirectX 8.0 headers and adds any necessary tweaks2627#include "SDL_windows.h"28#include <mmsystem.h>29#ifndef WIN3230#define WIN3231#endif32#undef WINNT3334// Far pointers don't exist in 32-bit code35#ifndef FAR36#define FAR37#endif3839// Error codes not yet included in Win32 API header files40#ifndef MAKE_HRESULT41#define MAKE_HRESULT(sev, fac, code) \42((HRESULT)(((unsigned long)(sev) << 31) | ((unsigned long)(fac) << 16) | ((unsigned long)(code))))43#endif4445#ifndef S_OK46#define S_OK (HRESULT)0x00000000L47#endif4849#ifndef SUCCEEDED50#define SUCCEEDED(x) ((HRESULT)(x) >= 0)51#endif52#ifndef FAILED53#define FAILED(x) ((HRESULT)(x) < 0)54#endif5556#ifndef E_FAIL57#define E_FAIL (HRESULT)0x80000008L58#endif59#ifndef E_NOINTERFACE60#define E_NOINTERFACE (HRESULT)0x80004002L61#endif62#ifndef E_OUTOFMEMORY63#define E_OUTOFMEMORY (HRESULT)0x8007000EL64#endif65#ifndef E_INVALIDARG66#define E_INVALIDARG (HRESULT)0x80070057L67#endif68#ifndef E_NOTIMPL69#define E_NOTIMPL (HRESULT)0x80004001L70#endif71#ifndef REGDB_E_CLASSNOTREG72#define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L73#endif7475// Severity codes76#ifndef SEVERITY_ERROR77#define SEVERITY_ERROR 178#endif7980// Error facility codes81#ifndef FACILITY_WIN3282#define FACILITY_WIN32 783#endif8485#ifndef FIELD_OFFSET86#define FIELD_OFFSET(type, field) ((LONG) & (((type *)0)->field))87#endif8889/* DirectX headers (if it isn't included, I haven't tested it yet)90*/91// We need these defines to mark what version of DirectX API we use92#define DIRECTDRAW_VERSION 0x070093#define DIRECTSOUND_VERSION 0x080094#define DIRECTINPUT_VERSION 0x0800 // Need version 7 for force feedback. Need version 8 so IDirectInput8_EnumDevices doesn't leak like a sieve...9596#ifdef HAVE_DDRAW_H97#include <ddraw.h>98#endif99#ifdef HAVE_DSOUND_H100#include <dsound.h>101#endif102#ifdef HAVE_DINPUT_H103#include <dinput.h>104#else105typedef struct106{107int unused;108} DIDEVICEINSTANCE;109#endif110111#endif // SDL_directx_h_112113114