src/haptic/windows/SDL_xinputhaptic.c
author Ryan C. Gordon <icculus@icculus.org>
Thu, 28 May 2015 01:22:14 -0400
changeset 9662 932e57cf5648
parent 9661 62a04df5afe1
child 9663 647180a6caad
permissions -rw-r--r--
Still trying to get this to compile...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8972
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
/*
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     2
  Simple DirectMedia Layer
9619
b94b6d0bff0f Updated the copyright year to 2015
Sam Lantinga <slouken@libsdl.org>
parents: 8972
diff changeset
     3
  Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
8972
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     5
  This software is provided 'as-is', without any express or implied
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     7
  arising from the use of this software.
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    11
  freely, subject to the following restrictions:
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    14
     claim that you wrote the original software. If you use this software
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    16
     appreciated but is not required.
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    18
     misrepresented as being the original software.
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
*/
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
#include "../../SDL_internal.h"
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
9661
62a04df5afe1 More patching to compile...
Ryan C. Gordon <icculus@icculus.org>
parents: 9658
diff changeset
    23
#include "SDL_error.h"
62a04df5afe1 More patching to compile...
Ryan C. Gordon <icculus@icculus.org>
parents: 9658
diff changeset
    24
#include "SDL_haptic.h"
9662
932e57cf5648 Still trying to get this to compile...
Ryan C. Gordon <icculus@icculus.org>
parents: 9661
diff changeset
    25
#include "../SDL_syshaptic.h"
9661
62a04df5afe1 More patching to compile...
Ryan C. Gordon <icculus@icculus.org>
parents: 9658
diff changeset
    26
9658
9753468b5c0e Move tests from SDL_config higher up in Windows joystick/haptic code.
Ryan C. Gordon <icculus@icculus.org>
parents: 9619
diff changeset
    27
#if SDL_HAPTIC_XINPUT
9753468b5c0e Move tests from SDL_config higher up in Windows joystick/haptic code.
Ryan C. Gordon <icculus@icculus.org>
parents: 9619
diff changeset
    28
8972
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    29
#include "SDL_assert.h"
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    30
#include "SDL_hints.h"
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    31
#include "SDL_timer.h"
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    32
#include "SDL_windowshaptic_c.h"
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    33
#include "SDL_xinputhaptic_c.h"
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    34
#include "../../core/windows/SDL_xinput.h"
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    35
#include "../../joystick/windows/SDL_windowsjoystick_c.h"
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    36
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    37
/*
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    38
 * Internal stuff.
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    39
 */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    40
static SDL_bool loaded_xinput = SDL_FALSE;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    41
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    42
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    43
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    44
SDL_XINPUT_HapticInit(void)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    45
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    46
    const char *env = SDL_GetHint(SDL_HINT_XINPUT_ENABLED);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    47
    if (!env || SDL_atoi(env)) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    48
        loaded_xinput = (WIN_LoadXInputDLL() == 0);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    49
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    50
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    51
    if (loaded_xinput) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    52
        DWORD i;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    53
        for (i = 0; i < XUSER_MAX_COUNT; i++) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    54
            SDL_XINPUT_MaybeAddDevice(i);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    55
        }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    56
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    57
    return 0;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    58
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    59
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    60
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    61
SDL_XINPUT_MaybeAddDevice(const DWORD dwUserid)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    62
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    63
    const Uint8 userid = (Uint8)dwUserid;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    64
    SDL_hapticlist_item *item;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    65
    XINPUT_VIBRATION state;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    66
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    67
    if ((!loaded_xinput) || (dwUserid >= XUSER_MAX_COUNT)) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    68
        return -1;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    69
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    70
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    71
    /* Make sure we don't already have it */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    72
    for (item = SDL_hapticlist; item; item = item->next) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    73
        if (item->bXInputHaptic && item->userid == userid) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    74
            return -1;  /* Already added */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    75
        }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    76
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    77
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    78
    SDL_zero(state);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    79
    if (XINPUTSETSTATE(dwUserid, &state) != ERROR_SUCCESS) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    80
        return -1;  /* no force feedback on this device. */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    81
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    82
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    83
    item = (SDL_hapticlist_item *)SDL_malloc(sizeof(SDL_hapticlist_item));
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    84
    if (item == NULL) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    85
        return SDL_OutOfMemory();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    86
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    87
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    88
    SDL_zerop(item);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    89
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    90
    /* !!! FIXME: I'm not bothering to query for a real name right now (can we even?) */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    91
    {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    92
        char buf[64];
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    93
        SDL_snprintf(buf, sizeof(buf), "XInput Controller #%u", (unsigned int)(userid + 1));
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    94
        item->name = SDL_strdup(buf);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    95
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    96
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    97
    if (!item->name) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    98
        SDL_free(item);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    99
        return -1;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   100
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   101
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   102
    /* Copy the instance over, useful for creating devices. */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   103
    item->bXInputHaptic = SDL_TRUE;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   104
    item->userid = userid;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   105
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   106
    return SDL_SYS_AddHapticDevice(item);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   107
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   108
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   109
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   110
SDL_XINPUT_MaybeRemoveDevice(const DWORD dwUserid)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   111
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   112
    const Uint8 userid = (Uint8)dwUserid;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   113
    SDL_hapticlist_item *item;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   114
    SDL_hapticlist_item *prev = NULL;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   115
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   116
    if ((!loaded_xinput) || (dwUserid >= XUSER_MAX_COUNT)) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   117
        return -1;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   118
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   119
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   120
    for (item = SDL_hapticlist; item != NULL; item = item->next) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   121
        if (item->bXInputHaptic && item->userid == userid) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   122
            /* found it, remove it. */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   123
            return SDL_SYS_RemoveHapticDevice(prev, item);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   124
        }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   125
        prev = item;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   126
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   127
    return -1;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   128
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   129
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   130
/* !!! FIXME: this is a hack, remove this later. */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   131
/* Since XInput doesn't offer a way to vibrate for X time, we hook into
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   132
 *  SDL_PumpEvents() to check if it's time to stop vibrating with some
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   133
 *  frequency.
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   134
 * In practice, this works for 99% of use cases. But in an ideal world,
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   135
 *  we do this in a separate thread so that:
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   136
 *    - we aren't bound to when the app chooses to pump the event queue.
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   137
 *    - we aren't adding more polling to the event queue
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   138
 *    - we can emulate all the haptic effects correctly (start on a delay,
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   139
 *      mix multiple effects, etc).
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   140
 *
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   141
 * Mostly, this is here to get rumbling to work, and all the other features
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   142
 *  are absent in the XInput path for now.  :(
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   143
 */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   144
static int SDLCALL
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   145
SDL_RunXInputHaptic(void *arg)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   146
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   147
    struct haptic_hwdata *hwdata = (struct haptic_hwdata *) arg;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   148
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   149
    while (!hwdata->stopThread) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   150
        SDL_Delay(50);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   151
        SDL_LockMutex(hwdata->mutex);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   152
        /* If we're currently running and need to stop... */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   153
        if (hwdata->stopTicks) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   154
            if ((hwdata->stopTicks != SDL_HAPTIC_INFINITY) && SDL_TICKS_PASSED(SDL_GetTicks(), hwdata->stopTicks)) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   155
                XINPUT_VIBRATION vibration = { 0, 0 };
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   156
                hwdata->stopTicks = 0;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   157
                XINPUTSETSTATE(hwdata->userid, &vibration);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   158
            }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   159
        }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   160
        SDL_UnlockMutex(hwdata->mutex);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   161
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   162
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   163
    return 0;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   164
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   165
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   166
static int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   167
SDL_XINPUT_HapticOpenFromUserIndex(SDL_Haptic *haptic, const Uint8 userid)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   168
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   169
    char threadName[32];
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   170
    XINPUT_VIBRATION vibration = { 0, 0 };  /* stop any current vibration */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   171
    XINPUTSETSTATE(userid, &vibration);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   172
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   173
    haptic->supported = SDL_HAPTIC_LEFTRIGHT;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   174
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   175
    haptic->neffects = 1;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   176
    haptic->nplaying = 1;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   177
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   178
    /* Prepare effects memory. */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   179
    haptic->effects = (struct haptic_effect *)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   180
        SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   181
    if (haptic->effects == NULL) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   182
        return SDL_OutOfMemory();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   183
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   184
    /* Clear the memory */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   185
    SDL_memset(haptic->effects, 0,
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   186
        sizeof(struct haptic_effect) * haptic->neffects);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   187
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   188
    haptic->hwdata = (struct haptic_hwdata *) SDL_malloc(sizeof(*haptic->hwdata));
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   189
    if (haptic->hwdata == NULL) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   190
        SDL_free(haptic->effects);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   191
        haptic->effects = NULL;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   192
        return SDL_OutOfMemory();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   193
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   194
    SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   195
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   196
    haptic->hwdata->bXInputHaptic = 1;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   197
    haptic->hwdata->userid = userid;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   198
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   199
    haptic->hwdata->mutex = SDL_CreateMutex();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   200
    if (haptic->hwdata->mutex == NULL) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   201
        SDL_free(haptic->effects);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   202
        SDL_free(haptic->hwdata);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   203
        haptic->effects = NULL;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   204
        return SDL_SetError("Couldn't create XInput haptic mutex");
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   205
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   206
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   207
    SDL_snprintf(threadName, sizeof(threadName), "SDLXInputDev%d", (int)userid);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   208
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   209
#if defined(__WIN32__) && !defined(HAVE_LIBC)  /* !!! FIXME: this is nasty. */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   210
#undef SDL_CreateThread
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   211
#if SDL_DYNAMIC_API
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   212
    haptic->hwdata->thread = SDL_CreateThread_REAL(SDL_RunXInputHaptic, threadName, haptic->hwdata, NULL, NULL);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   213
#else
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   214
    haptic->hwdata->thread = SDL_CreateThread(SDL_RunXInputHaptic, threadName, haptic->hwdata, NULL, NULL);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   215
#endif
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   216
#else
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   217
    haptic->hwdata->thread = SDL_CreateThread(SDL_RunXInputHaptic, threadName, haptic->hwdata);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   218
#endif
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   219
    if (haptic->hwdata->thread == NULL) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   220
        SDL_DestroyMutex(haptic->hwdata->mutex);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   221
        SDL_free(haptic->effects);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   222
        SDL_free(haptic->hwdata);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   223
        haptic->effects = NULL;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   224
        return SDL_SetError("Couldn't create XInput haptic thread");
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   225
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   226
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   227
    return 0;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   228
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   229
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   230
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   231
SDL_XINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   232
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   233
    return SDL_XINPUT_HapticOpenFromUserIndex(haptic, item->userid);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   234
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   235
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   236
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   237
SDL_XINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   238
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   239
    return (haptic->hwdata->userid == joystick->hwdata->userid);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   240
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   241
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   242
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   243
SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   244
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   245
    SDL_hapticlist_item *item;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   246
    int index = 0;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   247
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   248
    /* Since it comes from a joystick we have to try to match it with a haptic device on our haptic list. */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   249
    for (item = SDL_hapticlist; item != NULL; item = item->next) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   250
        if (item->bXInputHaptic && item->userid == joystick->hwdata->userid) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   251
            haptic->index = index;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   252
            return SDL_XINPUT_HapticOpenFromUserIndex(haptic, joystick->hwdata->userid);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   253
        }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   254
        ++index;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   255
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   256
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   257
    SDL_SetError("Couldn't find joystick in haptic device list");
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   258
    return -1;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   259
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   260
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   261
void
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   262
SDL_XINPUT_HapticClose(SDL_Haptic * haptic)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   263
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   264
    haptic->hwdata->stopThread = 1;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   265
    SDL_WaitThread(haptic->hwdata->thread, NULL);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   266
    SDL_DestroyMutex(haptic->hwdata->mutex);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   267
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   268
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   269
void
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   270
SDL_XINPUT_HapticQuit(void)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   271
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   272
    if (loaded_xinput) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   273
        WIN_UnloadXInputDLL();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   274
        loaded_xinput = SDL_FALSE;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   275
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   276
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   277
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   278
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   279
SDL_XINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   280
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   281
    SDL_assert(base->type == SDL_HAPTIC_LEFTRIGHT);  /* should catch this at higher level */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   282
    return SDL_XINPUT_HapticUpdateEffect(haptic, effect, base);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   283
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   284
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   285
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   286
SDL_XINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * data)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   287
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   288
    XINPUT_VIBRATION *vib = &effect->hweffect->vibration;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   289
    SDL_assert(data->type == SDL_HAPTIC_LEFTRIGHT);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   290
    vib->wLeftMotorSpeed = data->leftright.large_magnitude;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   291
    vib->wRightMotorSpeed = data->leftright.small_magnitude;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   292
    SDL_LockMutex(haptic->hwdata->mutex);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   293
    if (haptic->hwdata->stopTicks) {  /* running right now? Update it. */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   294
        XINPUTSETSTATE(haptic->hwdata->userid, vib);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   295
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   296
    SDL_UnlockMutex(haptic->hwdata->mutex);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   297
    return 0;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   298
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   299
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   300
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   301
SDL_XINPUT_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Uint32 iterations)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   302
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   303
    XINPUT_VIBRATION *vib = &effect->hweffect->vibration;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   304
    SDL_assert(effect->effect.type == SDL_HAPTIC_LEFTRIGHT);  /* should catch this at higher level */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   305
    SDL_LockMutex(haptic->hwdata->mutex);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   306
    if (effect->effect.leftright.length == SDL_HAPTIC_INFINITY || iterations == SDL_HAPTIC_INFINITY) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   307
        haptic->hwdata->stopTicks = SDL_HAPTIC_INFINITY;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   308
    } else if ((!effect->effect.leftright.length) || (!iterations)) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   309
        /* do nothing. Effect runs for zero milliseconds. */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   310
    } else {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   311
        haptic->hwdata->stopTicks = SDL_GetTicks() + (effect->effect.leftright.length * iterations);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   312
        if ((haptic->hwdata->stopTicks == SDL_HAPTIC_INFINITY) || (haptic->hwdata->stopTicks == 0)) {
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   313
            haptic->hwdata->stopTicks = 1;  /* fix edge cases. */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   314
        }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   315
    }
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   316
    SDL_UnlockMutex(haptic->hwdata->mutex);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   317
    return (XINPUTSETSTATE(haptic->hwdata->userid, vib) == ERROR_SUCCESS) ? 0 : -1;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   318
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   319
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   320
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   321
SDL_XINPUT_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   322
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   323
    XINPUT_VIBRATION vibration = { 0, 0 };
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   324
    SDL_LockMutex(haptic->hwdata->mutex);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   325
    haptic->hwdata->stopTicks = 0;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   326
    SDL_UnlockMutex(haptic->hwdata->mutex);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   327
    return (XINPUTSETSTATE(haptic->hwdata->userid, &vibration) == ERROR_SUCCESS) ? 0 : -1;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   328
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   329
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   330
void
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   331
SDL_XINPUT_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   332
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   333
    SDL_XINPUT_HapticStopEffect(haptic, effect);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   334
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   335
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   336
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   337
SDL_XINPUT_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect *effect)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   338
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   339
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   340
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   341
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   342
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   343
SDL_XINPUT_HapticSetGain(SDL_Haptic * haptic, int gain)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   344
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   345
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   346
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   347
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   348
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   349
SDL_XINPUT_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   350
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   351
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   352
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   353
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   354
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   355
SDL_XINPUT_HapticPause(SDL_Haptic * haptic)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   356
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   357
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   358
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   359
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   360
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   361
SDL_XINPUT_HapticUnpause(SDL_Haptic * haptic)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   362
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   363
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   364
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   365
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   366
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   367
SDL_XINPUT_HapticStopAll(SDL_Haptic * haptic)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   368
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   369
    XINPUT_VIBRATION vibration = { 0, 0 };
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   370
    SDL_LockMutex(haptic->hwdata->mutex);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   371
    haptic->hwdata->stopTicks = 0;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   372
    SDL_UnlockMutex(haptic->hwdata->mutex);
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   373
    return (XINPUTSETSTATE(haptic->hwdata->userid, &vibration) == ERROR_SUCCESS) ? 0 : -1;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   374
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   375
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   376
#else /* !SDL_HAPTIC_XINPUT */
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   377
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   378
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   379
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   380
SDL_XINPUT_HapticInit(void)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   381
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   382
    return 0;
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   383
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   384
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   385
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   386
SDL_XINPUT_MaybeAddDevice(const DWORD dwUserid)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   387
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   388
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   389
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   390
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   391
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   392
SDL_XINPUT_MaybeRemoveDevice(const DWORD dwUserid)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   393
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   394
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   395
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   396
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   397
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   398
SDL_XINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   399
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   400
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   401
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   402
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   403
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   404
SDL_XINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   405
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   406
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   407
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   408
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   409
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   410
SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   411
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   412
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   413
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   414
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   415
void
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   416
SDL_XINPUT_HapticClose(SDL_Haptic * haptic)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   417
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   418
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   419
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   420
void
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   421
SDL_XINPUT_HapticQuit(void)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   422
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   423
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   424
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   425
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   426
SDL_XINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   427
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   428
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   429
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   430
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   431
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   432
SDL_XINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * data)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   433
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   434
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   435
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   436
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   437
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   438
SDL_XINPUT_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Uint32 iterations)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   439
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   440
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   441
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   442
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   443
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   444
SDL_XINPUT_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   445
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   446
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   447
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   448
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   449
void
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   450
SDL_XINPUT_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   451
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   452
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   453
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   454
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   455
SDL_XINPUT_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect *effect)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   456
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   457
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   458
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   459
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   460
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   461
SDL_XINPUT_HapticSetGain(SDL_Haptic * haptic, int gain)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   462
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   463
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   464
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   465
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   466
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   467
SDL_XINPUT_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   468
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   469
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   470
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   471
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   472
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   473
SDL_XINPUT_HapticPause(SDL_Haptic * haptic)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   474
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   475
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   476
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   477
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   478
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   479
SDL_XINPUT_HapticUnpause(SDL_Haptic * haptic)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   480
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   481
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   482
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   483
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   484
int
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   485
SDL_XINPUT_HapticStopAll(SDL_Haptic * haptic)
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   486
{
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   487
    return SDL_Unsupported();
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   488
}
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   489
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   490
#endif /* SDL_HAPTIC_XINPUT */
9658
9753468b5c0e Move tests from SDL_config higher up in Windows joystick/haptic code.
Ryan C. Gordon <icculus@icculus.org>
parents: 9619
diff changeset
   491
8972
dfc759d7486f Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   492
/* vi: set ts=4 sw=4 expandtab: */