Path: blob/master/thirdparty/sdl/haptic/windows/SDL_windowshaptic_c.h
9912 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_windowshaptic_c_h_23#define SDL_windowshaptic_c_h_2425#include "../SDL_syshaptic.h"26#include "../../core/windows/SDL_directx.h"27#include "../../core/windows/SDL_xinput.h"2829// Set up for C function definitions, even when using C++30#ifdef __cplusplus31extern "C" {32#endif3334/*35* Haptic system hardware data.36*/37struct haptic_hwdata38{39#ifdef SDL_HAPTIC_DINPUT40LPDIRECTINPUTDEVICE8 device;41#endif42DWORD axes[3]; // Axes to use.43bool is_joystick; // Device is loaded as joystick.44SDL_Thread *thread;45SDL_Mutex *mutex;46Uint64 stopTicks;47SDL_AtomicInt stopThread;48};4950/*51* Haptic system effect data.52*/53#ifdef SDL_HAPTIC_DINPUT54struct haptic_hweffect55{56DIEFFECT effect;57LPDIRECTINPUTEFFECT ref;58};59#endif6061/*62* List of available haptic devices.63*/64typedef struct SDL_hapticlist_item65{66SDL_HapticID instance_id;67char *name;68SDL_Haptic *haptic;69#ifdef SDL_HAPTIC_DINPUT70DIDEVICEINSTANCE instance;71DIDEVCAPS capabilities;72#endif73struct SDL_hapticlist_item *next;74} SDL_hapticlist_item;7576extern SDL_hapticlist_item *SDL_hapticlist;7778extern bool SDL_SYS_AddHapticDevice(SDL_hapticlist_item *item);79extern bool SDL_SYS_RemoveHapticDevice(SDL_hapticlist_item *prev, SDL_hapticlist_item *item);8081// Ends C function definitions when using C++82#ifdef __cplusplus83}84#endif8586#endif // SDL_windowshaptic_c_h_878889