#include "SDL_internal.h"
#include "../SDL_sysjoystick.h"
#include "../../core/windows/SDL_windows.h"
#include "../../core/windows/SDL_directx.h"
#define MAX_INPUTS 256
#ifdef __cplusplus
extern "C" {
#endif
typedef struct JoyStick_DeviceData
{
SDL_GUID guid;
char *joystickname;
Uint8 send_add_event;
SDL_JoystickID nInstanceID;
#ifdef SDL_JOYSTICK_XINPUT
bool bXInputDevice;
BYTE SubType;
Uint8 XInputUserId;
#endif
DIDEVICEINSTANCE dxdevice;
char path[MAX_PATH];
int steam_virtual_gamepad_slot;
struct JoyStick_DeviceData *pNext;
} JoyStick_DeviceData;
extern JoyStick_DeviceData *SYS_Joystick;
typedef enum Type
{
BUTTON,
AXIS,
HAT
} Type;
typedef struct input_t
{
DWORD ofs;
Type type;
Uint8 num;
} input_t;
struct joystick_hwdata
{
SDL_GUID guid;
#ifdef SDL_JOYSTICK_DINPUT
LPDIRECTINPUTDEVICE8 InputDevice;
DIDEVCAPS Capabilities;
bool buffered;
bool first_update;
input_t Inputs[MAX_INPUTS];
int NumInputs;
int NumSliders;
bool ff_initialized;
DIEFFECT *ffeffect;
LPDIRECTINPUTEFFECT ffeffect_ref;
#endif
#ifdef SDL_JOYSTICK_XINPUT
bool bXInputDevice; bool bXInputHaptic; Uint8 userid; DWORD dwPacketNumber;
#endif
};
#ifdef SDL_JOYSTICK_DINPUT
extern const DIDATAFORMAT SDL_c_dfDIJoystick2;
#endif
extern void WINDOWS_AddJoystickDevice(JoyStick_DeviceData *device);
#ifdef __cplusplus
}
#endif