src/joystick/windows/SDL_xinputjoystick.c
author Sam Lantinga <slouken@libsdl.org>
Mon, 07 Jul 2014 10:26:28 -0700
changeset 8976 1a5d959d7b32
parent 8972 dfc759d7486f
child 8987 d0fd8420b019
permissions -rw-r--r--
Fixed mingw64 build and warnings
slouken@8972
     1
/*
slouken@8972
     2
  Simple DirectMedia Layer
slouken@8972
     3
  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
slouken@8972
     4
slouken@8972
     5
  This software is provided 'as-is', without any express or implied
slouken@8972
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@8972
     7
  arising from the use of this software.
slouken@8972
     8
slouken@8972
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@8972
    10
  including commercial applications, and to alter it and redistribute it
slouken@8972
    11
  freely, subject to the following restrictions:
slouken@8972
    12
slouken@8972
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@8972
    14
     claim that you wrote the original software. If you use this software
slouken@8972
    15
     in a product, an acknowledgment in the product documentation would be
slouken@8972
    16
     appreciated but is not required.
slouken@8972
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@8972
    18
     misrepresented as being the original software.
slouken@8972
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@8972
    20
*/
slouken@8972
    21
#include "../../SDL_internal.h"
slouken@8972
    22
slouken@8972
    23
#include "SDL_assert.h"
slouken@8972
    24
#include "SDL_hints.h"
slouken@8972
    25
#include "../SDL_sysjoystick.h"
slouken@8972
    26
#include "SDL_windowsjoystick_c.h"
slouken@8972
    27
#include "SDL_xinputjoystick_c.h"
slouken@8972
    28
slouken@8972
    29
slouken@8972
    30
#if SDL_JOYSTICK_XINPUT
slouken@8972
    31
slouken@8972
    32
/*
slouken@8972
    33
 * Internal stuff.
slouken@8972
    34
 */
slouken@8972
    35
static SDL_bool s_bXInputEnabled = SDL_TRUE;
slouken@8972
    36
slouken@8972
    37
slouken@8972
    38
static SDL_bool
slouken@8972
    39
SDL_XInputUseOldJoystickMapping()
slouken@8972
    40
{
slouken@8972
    41
    static int s_XInputUseOldJoystickMapping = -1;
slouken@8972
    42
    if (s_XInputUseOldJoystickMapping < 0) {
slouken@8972
    43
        const char *hint = SDL_GetHint(SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING);
slouken@8972
    44
        s_XInputUseOldJoystickMapping = (hint && *hint == '1') ? 1 : 0;
slouken@8972
    45
    }
slouken@8972
    46
    return (s_XInputUseOldJoystickMapping > 0);
slouken@8972
    47
}
slouken@8972
    48
slouken@8972
    49
SDL_bool SDL_XINPUT_Enabled(void)
slouken@8972
    50
{
slouken@8972
    51
    return s_bXInputEnabled;
slouken@8972
    52
}
slouken@8972
    53
slouken@8972
    54
int
slouken@8972
    55
SDL_XINPUT_JoystickInit(void)
slouken@8972
    56
{
slouken@8972
    57
    const char *env = SDL_GetHint(SDL_HINT_XINPUT_ENABLED);
slouken@8972
    58
    if (env && !SDL_atoi(env)) {
slouken@8972
    59
        s_bXInputEnabled = SDL_FALSE;
slouken@8972
    60
    }
slouken@8972
    61
slouken@8972
    62
    if (s_bXInputEnabled && WIN_LoadXInputDLL() < 0) {
slouken@8972
    63
        s_bXInputEnabled = SDL_FALSE;  /* oh well. */
slouken@8972
    64
    }
slouken@8972
    65
    return 0;
slouken@8972
    66
}
slouken@8972
    67
slouken@8972
    68
static char *
slouken@8972
    69
GetXInputName(const Uint8 userid, BYTE SubType)
slouken@8972
    70
{
slouken@8972
    71
    char name[32];
slouken@8972
    72
slouken@8972
    73
    if (SDL_XInputUseOldJoystickMapping()) {
slouken@8972
    74
        SDL_snprintf(name, sizeof(name), "X360 Controller #%u", 1 + userid);
slouken@8972
    75
    } else {
slouken@8972
    76
        switch (SubType) {
slouken@8972
    77
        case XINPUT_DEVSUBTYPE_GAMEPAD:
slouken@8972
    78
            SDL_snprintf(name, sizeof(name), "XInput Controller #%u", 1 + userid);
slouken@8972
    79
            break;
slouken@8972
    80
        case XINPUT_DEVSUBTYPE_WHEEL:
slouken@8972
    81
            SDL_snprintf(name, sizeof(name), "XInput Wheel #%u", 1 + userid);
slouken@8972
    82
            break;
slouken@8972
    83
        case XINPUT_DEVSUBTYPE_ARCADE_STICK:
slouken@8972
    84
            SDL_snprintf(name, sizeof(name), "XInput ArcadeStick #%u", 1 + userid);
slouken@8972
    85
            break;
slouken@8972
    86
        case XINPUT_DEVSUBTYPE_FLIGHT_STICK:
slouken@8972
    87
            SDL_snprintf(name, sizeof(name), "XInput FlightStick #%u", 1 + userid);
slouken@8972
    88
            break;
slouken@8972
    89
        case XINPUT_DEVSUBTYPE_DANCE_PAD:
slouken@8972
    90
            SDL_snprintf(name, sizeof(name), "XInput DancePad #%u", 1 + userid);
slouken@8972
    91
            break;
slouken@8972
    92
        case XINPUT_DEVSUBTYPE_GUITAR:
slouken@8972
    93
        case XINPUT_DEVSUBTYPE_GUITAR_ALTERNATE:
slouken@8972
    94
        case XINPUT_DEVSUBTYPE_GUITAR_BASS:
slouken@8972
    95
            SDL_snprintf(name, sizeof(name), "XInput Guitar #%u", 1 + userid);
slouken@8972
    96
            break;
slouken@8972
    97
        case XINPUT_DEVSUBTYPE_DRUM_KIT:
slouken@8972
    98
            SDL_snprintf(name, sizeof(name), "XInput DrumKit #%u", 1 + userid);
slouken@8972
    99
            break;
slouken@8972
   100
        case XINPUT_DEVSUBTYPE_ARCADE_PAD:
slouken@8972
   101
            SDL_snprintf(name, sizeof(name), "XInput ArcadePad #%u", 1 + userid);
slouken@8972
   102
            break;
slouken@8972
   103
        default:
slouken@8972
   104
            SDL_snprintf(name, sizeof(name), "XInput Device #%u", 1 + userid);
slouken@8972
   105
            break;
slouken@8972
   106
        }
slouken@8972
   107
    }
slouken@8972
   108
    return SDL_strdup(name);
slouken@8972
   109
}
slouken@8972
   110
slouken@8972
   111
static void
slouken@8972
   112
AddXInputDevice(const Uint8 userid, BYTE SubType, JoyStick_DeviceData **pContext)
slouken@8972
   113
{
slouken@8972
   114
    JoyStick_DeviceData *pPrevJoystick = NULL;
slouken@8972
   115
    JoyStick_DeviceData *pNewJoystick = *pContext;
slouken@8972
   116
slouken@8972
   117
    if (SDL_XInputUseOldJoystickMapping() && SubType != XINPUT_DEVSUBTYPE_GAMEPAD)
slouken@8972
   118
        return;
slouken@8972
   119
slouken@8972
   120
    if (SubType == XINPUT_DEVSUBTYPE_UNKNOWN)
slouken@8972
   121
        return;
slouken@8972
   122
slouken@8972
   123
    while (pNewJoystick) {
slouken@8972
   124
        if (pNewJoystick->bXInputDevice && (pNewJoystick->XInputUserId == userid) && (pNewJoystick->SubType == SubType)) {
slouken@8972
   125
            /* if we are replacing the front of the list then update it */
slouken@8972
   126
            if (pNewJoystick == *pContext) {
slouken@8972
   127
                *pContext = pNewJoystick->pNext;
slouken@8972
   128
            } else if (pPrevJoystick) {
slouken@8972
   129
                pPrevJoystick->pNext = pNewJoystick->pNext;
slouken@8972
   130
            }
slouken@8972
   131
slouken@8972
   132
            pNewJoystick->pNext = SYS_Joystick;
slouken@8972
   133
            SYS_Joystick = pNewJoystick;
slouken@8972
   134
            return;   /* already in the list. */
slouken@8972
   135
        }
slouken@8972
   136
slouken@8972
   137
        pPrevJoystick = pNewJoystick;
slouken@8972
   138
        pNewJoystick = pNewJoystick->pNext;
slouken@8972
   139
    }
slouken@8972
   140
slouken@8972
   141
    pNewJoystick = (JoyStick_DeviceData *)SDL_malloc(sizeof(JoyStick_DeviceData));
slouken@8972
   142
    if (!pNewJoystick) {
slouken@8972
   143
        return; /* better luck next time? */
slouken@8972
   144
    }
slouken@8972
   145
    SDL_zerop(pNewJoystick);
slouken@8972
   146
slouken@8972
   147
    pNewJoystick->joystickname = GetXInputName(userid, SubType);
slouken@8972
   148
    if (!pNewJoystick->joystickname) {
slouken@8972
   149
        SDL_free(pNewJoystick);
slouken@8972
   150
        return; /* better luck next time? */
slouken@8972
   151
    }
slouken@8972
   152
slouken@8972
   153
    pNewJoystick->bXInputDevice = SDL_TRUE;
slouken@8972
   154
    if (SDL_XInputUseOldJoystickMapping()) {
slouken@8972
   155
        SDL_zero(pNewJoystick->guid);
slouken@8972
   156
    } else {
slouken@8972
   157
        pNewJoystick->guid.data[0] = 'x';
slouken@8972
   158
        pNewJoystick->guid.data[1] = 'i';
slouken@8972
   159
        pNewJoystick->guid.data[2] = 'n';
slouken@8972
   160
        pNewJoystick->guid.data[3] = 'p';
slouken@8972
   161
        pNewJoystick->guid.data[4] = 'u';
slouken@8972
   162
        pNewJoystick->guid.data[5] = 't';
slouken@8972
   163
        pNewJoystick->guid.data[6] = SubType;
slouken@8972
   164
    }
slouken@8972
   165
    pNewJoystick->SubType = SubType;
slouken@8972
   166
    pNewJoystick->XInputUserId = userid;
slouken@8972
   167
    SDL_SYS_AddJoystickDevice(pNewJoystick);
slouken@8972
   168
}
slouken@8972
   169
slouken@8972
   170
void
slouken@8972
   171
SDL_XINPUT_JoystickDetect(JoyStick_DeviceData **pContext)
slouken@8972
   172
{
slouken@8972
   173
    int iuserid;
slouken@8972
   174
slouken@8972
   175
    if (!s_bXInputEnabled) {
slouken@8972
   176
        return;
slouken@8972
   177
    }
slouken@8972
   178
slouken@8972
   179
    /* iterate in reverse, so these are in the final list in ascending numeric order. */
slouken@8972
   180
    for (iuserid = XUSER_MAX_COUNT - 1; iuserid >= 0; iuserid--) {
slouken@8972
   181
        const Uint8 userid = (Uint8)iuserid;
slouken@8972
   182
        XINPUT_CAPABILITIES capabilities;
slouken@8972
   183
        if (XINPUTGETCAPABILITIES(userid, XINPUT_FLAG_GAMEPAD, &capabilities) == ERROR_SUCCESS) {
slouken@8972
   184
            AddXInputDevice(userid, capabilities.SubType, pContext);
slouken@8972
   185
        }
slouken@8972
   186
    }
slouken@8972
   187
}
slouken@8972
   188
slouken@8972
   189
int
slouken@8972
   190
SDL_XINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickdevice)
slouken@8972
   191
{
slouken@8972
   192
    const Uint8 userId = joystickdevice->XInputUserId;
slouken@8972
   193
    XINPUT_CAPABILITIES capabilities;
slouken@8972
   194
    XINPUT_VIBRATION state;
slouken@8972
   195
slouken@8972
   196
    SDL_assert(s_bXInputEnabled);
slouken@8972
   197
    SDL_assert(XINPUTGETCAPABILITIES);
slouken@8972
   198
    SDL_assert(XINPUTSETSTATE);
slouken@8972
   199
    SDL_assert(userId >= 0);
slouken@8972
   200
    SDL_assert(userId < XUSER_MAX_COUNT);
slouken@8972
   201
slouken@8972
   202
    joystick->hwdata->bXInputDevice = SDL_TRUE;
slouken@8972
   203
slouken@8972
   204
    if (XINPUTGETCAPABILITIES(userId, XINPUT_FLAG_GAMEPAD, &capabilities) != ERROR_SUCCESS) {
slouken@8972
   205
        SDL_free(joystick->hwdata);
slouken@8972
   206
        joystick->hwdata = NULL;
slouken@8972
   207
        return SDL_SetError("Failed to obtain XInput device capabilities. Device disconnected?");
slouken@8972
   208
    }
slouken@8972
   209
    SDL_zero(state);
slouken@8972
   210
    joystick->hwdata->bXInputHaptic = (XINPUTSETSTATE(userId, &state) == ERROR_SUCCESS);
slouken@8972
   211
    joystick->hwdata->userid = userId;
slouken@8972
   212
slouken@8972
   213
    /* The XInput API has a hard coded button/axis mapping, so we just match it */
slouken@8972
   214
    if (SDL_XInputUseOldJoystickMapping()) {
slouken@8972
   215
        joystick->naxes = 6;
slouken@8972
   216
        joystick->nbuttons = 15;
slouken@8972
   217
    } else {
slouken@8972
   218
        joystick->naxes = 6;
slouken@8972
   219
        joystick->nbuttons = 11;
slouken@8972
   220
        joystick->nhats = 1;
slouken@8972
   221
    }
slouken@8972
   222
    return 0;
slouken@8972
   223
}
slouken@8972
   224
slouken@8972
   225
static void
slouken@8972
   226
UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState)
slouken@8972
   227
{
slouken@8972
   228
    static WORD s_XInputButtons[] = {
slouken@8972
   229
        XINPUT_GAMEPAD_DPAD_UP, XINPUT_GAMEPAD_DPAD_DOWN, XINPUT_GAMEPAD_DPAD_LEFT, XINPUT_GAMEPAD_DPAD_RIGHT,
slouken@8972
   230
        XINPUT_GAMEPAD_START, XINPUT_GAMEPAD_BACK, XINPUT_GAMEPAD_LEFT_THUMB, XINPUT_GAMEPAD_RIGHT_THUMB,
slouken@8972
   231
        XINPUT_GAMEPAD_LEFT_SHOULDER, XINPUT_GAMEPAD_RIGHT_SHOULDER,
slouken@8972
   232
        XINPUT_GAMEPAD_A, XINPUT_GAMEPAD_B, XINPUT_GAMEPAD_X, XINPUT_GAMEPAD_Y,
slouken@8972
   233
        XINPUT_GAMEPAD_GUIDE
slouken@8972
   234
    };
slouken@8972
   235
    WORD wButtons = pXInputState->Gamepad.wButtons;
slouken@8972
   236
    Uint8 button;
slouken@8972
   237
slouken@8972
   238
    SDL_PrivateJoystickAxis(joystick, 0, (Sint16)pXInputState->Gamepad.sThumbLX);
slouken@8972
   239
    SDL_PrivateJoystickAxis(joystick, 1, (Sint16)(-SDL_max(-32767, pXInputState->Gamepad.sThumbLY)));
slouken@8972
   240
    SDL_PrivateJoystickAxis(joystick, 2, (Sint16)pXInputState->Gamepad.sThumbRX);
slouken@8972
   241
    SDL_PrivateJoystickAxis(joystick, 3, (Sint16)(-SDL_max(-32767, pXInputState->Gamepad.sThumbRY)));
slouken@8972
   242
    SDL_PrivateJoystickAxis(joystick, 4, (Sint16)(((int)pXInputState->Gamepad.bLeftTrigger * 65535 / 255) - 32768));
slouken@8972
   243
    SDL_PrivateJoystickAxis(joystick, 5, (Sint16)(((int)pXInputState->Gamepad.bRightTrigger * 65535 / 255) - 32768));
slouken@8972
   244
slouken@8972
   245
    for (button = 0; button < SDL_arraysize(s_XInputButtons); ++button) {
slouken@8972
   246
        SDL_PrivateJoystickButton(joystick, button, (wButtons & s_XInputButtons[button]) ? SDL_PRESSED : SDL_RELEASED);
slouken@8972
   247
    }
slouken@8972
   248
}
slouken@8972
   249
slouken@8972
   250
static void
slouken@8972
   251
UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState)
slouken@8972
   252
{
slouken@8972
   253
    static WORD s_XInputButtons[] = {
slouken@8972
   254
        XINPUT_GAMEPAD_A, XINPUT_GAMEPAD_B, XINPUT_GAMEPAD_X, XINPUT_GAMEPAD_Y,
slouken@8972
   255
        XINPUT_GAMEPAD_LEFT_SHOULDER, XINPUT_GAMEPAD_RIGHT_SHOULDER, XINPUT_GAMEPAD_BACK, XINPUT_GAMEPAD_START,
slouken@8972
   256
        XINPUT_GAMEPAD_LEFT_THUMB, XINPUT_GAMEPAD_RIGHT_THUMB,
slouken@8972
   257
        XINPUT_GAMEPAD_GUIDE
slouken@8972
   258
    };
slouken@8972
   259
    WORD wButtons = pXInputState->Gamepad.wButtons;
slouken@8972
   260
    Uint8 button;
slouken@8972
   261
    Uint8 hat = SDL_HAT_CENTERED;
slouken@8972
   262
slouken@8972
   263
    SDL_PrivateJoystickAxis(joystick, 0, (Sint16)pXInputState->Gamepad.sThumbLX);
slouken@8972
   264
    SDL_PrivateJoystickAxis(joystick, 1, (Sint16)(-SDL_max(-32767, pXInputState->Gamepad.sThumbLY)));
slouken@8972
   265
    SDL_PrivateJoystickAxis(joystick, 2, (Sint16)(((int)pXInputState->Gamepad.bLeftTrigger * 65535 / 255) - 32768));
slouken@8972
   266
    SDL_PrivateJoystickAxis(joystick, 3, (Sint16)pXInputState->Gamepad.sThumbRX);
slouken@8972
   267
    SDL_PrivateJoystickAxis(joystick, 4, (Sint16)(-SDL_max(-32767, pXInputState->Gamepad.sThumbRY)));
slouken@8972
   268
    SDL_PrivateJoystickAxis(joystick, 5, (Sint16)(((int)pXInputState->Gamepad.bRightTrigger * 65535 / 255) - 32768));
slouken@8972
   269
slouken@8972
   270
    for (button = 0; button < SDL_arraysize(s_XInputButtons); ++button) {
slouken@8972
   271
        SDL_PrivateJoystickButton(joystick, button, (wButtons & s_XInputButtons[button]) ? SDL_PRESSED : SDL_RELEASED);
slouken@8972
   272
    }
slouken@8972
   273
slouken@8972
   274
    if (wButtons & XINPUT_GAMEPAD_DPAD_UP) {
slouken@8972
   275
        hat |= SDL_HAT_UP;
slouken@8972
   276
    }
slouken@8972
   277
    if (wButtons & XINPUT_GAMEPAD_DPAD_DOWN) {
slouken@8972
   278
        hat |= SDL_HAT_DOWN;
slouken@8972
   279
    }
slouken@8972
   280
    if (wButtons & XINPUT_GAMEPAD_DPAD_LEFT) {
slouken@8972
   281
        hat |= SDL_HAT_LEFT;
slouken@8972
   282
    }
slouken@8972
   283
    if (wButtons & XINPUT_GAMEPAD_DPAD_RIGHT) {
slouken@8972
   284
        hat |= SDL_HAT_RIGHT;
slouken@8972
   285
    }
slouken@8972
   286
    SDL_PrivateJoystickHat(joystick, 0, hat);
slouken@8972
   287
}
slouken@8972
   288
slouken@8972
   289
void
slouken@8972
   290
SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick)
slouken@8972
   291
{
slouken@8972
   292
    HRESULT result;
slouken@8972
   293
    XINPUT_STATE_EX XInputState;
slouken@8972
   294
slouken@8972
   295
    if (!XINPUTGETSTATE)
slouken@8972
   296
        return;
slouken@8972
   297
slouken@8972
   298
    result = XINPUTGETSTATE(joystick->hwdata->userid, &XInputState);
slouken@8972
   299
    if (result == ERROR_DEVICE_NOT_CONNECTED) {
slouken@8972
   300
        joystick->hwdata->send_remove_event = SDL_TRUE;
slouken@8972
   301
        joystick->hwdata->removed = SDL_TRUE;
slouken@8972
   302
        return;
slouken@8972
   303
    }
slouken@8972
   304
slouken@8972
   305
    /* only fire events if the data changed from last time */
slouken@8972
   306
    if (XInputState.dwPacketNumber && XInputState.dwPacketNumber != joystick->hwdata->dwPacketNumber) {
slouken@8972
   307
        if (SDL_XInputUseOldJoystickMapping()) {
slouken@8972
   308
            UpdateXInputJoystickState_OLD(joystick, &XInputState);
slouken@8972
   309
        } else {
slouken@8972
   310
            UpdateXInputJoystickState(joystick, &XInputState);
slouken@8972
   311
        }
slouken@8972
   312
        joystick->hwdata->dwPacketNumber = XInputState.dwPacketNumber;
slouken@8972
   313
    }
slouken@8972
   314
}
slouken@8972
   315
slouken@8972
   316
void
slouken@8972
   317
SDL_XINPUT_JoystickClose(SDL_Joystick * joystick)
slouken@8972
   318
{
slouken@8972
   319
}
slouken@8972
   320
slouken@8972
   321
void
slouken@8972
   322
SDL_XINPUT_JoystickQuit(void)
slouken@8972
   323
{
slouken@8972
   324
    if (s_bXInputEnabled) {
slouken@8972
   325
        WIN_UnloadXInputDLL();
slouken@8972
   326
    }
slouken@8972
   327
}
slouken@8972
   328
slouken@8972
   329
SDL_bool
slouken@8972
   330
SDL_SYS_IsXInputGamepad_DeviceIndex(int device_index)
slouken@8972
   331
{
slouken@8972
   332
    JoyStick_DeviceData *device = SYS_Joystick;
slouken@8972
   333
    int index;
slouken@8972
   334
slouken@8972
   335
    for (index = device_index; index > 0; index--)
slouken@8972
   336
        device = device->pNext;
slouken@8972
   337
slouken@8972
   338
    return (device->SubType == XINPUT_DEVSUBTYPE_GAMEPAD);
slouken@8972
   339
}
slouken@8972
   340
slouken@8972
   341
#else /* !SDL_JOYSTICK_XINPUT */
slouken@8972
   342
slouken@8972
   343
slouken@8972
   344
SDL_bool SDL_XINPUT_Enabled(void)
slouken@8972
   345
{
slouken@8972
   346
    return SDL_FALSE;
slouken@8972
   347
}
slouken@8972
   348
slouken@8972
   349
int
slouken@8972
   350
SDL_XINPUT_JoystickInit(void)
slouken@8972
   351
{
slouken@8972
   352
    return 0;
slouken@8972
   353
}
slouken@8972
   354
slouken@8972
   355
void
slouken@8972
   356
SDL_XINPUT_JoystickDetect(JoyStick_DeviceData **pContext)
slouken@8972
   357
{
slouken@8972
   358
}
slouken@8972
   359
slouken@8972
   360
int
slouken@8972
   361
SDL_XINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickdevice)
slouken@8972
   362
{
slouken@8972
   363
    return SDL_Unsupported();
slouken@8972
   364
}
slouken@8972
   365
slouken@8972
   366
void
slouken@8972
   367
SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick)
slouken@8972
   368
{
slouken@8972
   369
}
slouken@8972
   370
slouken@8972
   371
void
slouken@8972
   372
SDL_XINPUT_JoystickClose(SDL_Joystick * joystick)
slouken@8972
   373
{
slouken@8972
   374
}
slouken@8972
   375
slouken@8972
   376
void
slouken@8972
   377
SDL_XINPUT_JoystickQuit(void)
slouken@8972
   378
{
slouken@8972
   379
}
slouken@8972
   380
slouken@8972
   381
#endif /* SDL_JOYSTICK_XINPUT */
slouken@8972
   382
slouken@8972
   383
/* vi: set ts=4 sw=4 expandtab: */