src/haptic/windows/SDL_windowshaptic_c.h
changeset 8972 dfc759d7486f
parent 8179 48c90b62af13
child 8976 1a5d959d7b32
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/haptic/windows/SDL_windowshaptic_c.h	Thu Jul 03 15:39:55 2014 -0700
     1.3 @@ -0,0 +1,88 @@
     1.4 +/*
     1.5 +  Simple DirectMedia Layer
     1.6 +  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
     1.7 +
     1.8 +  This software is provided 'as-is', without any express or implied
     1.9 +  warranty.  In no event will the authors be held liable for any damages
    1.10 +  arising from the use of this software.
    1.11 +
    1.12 +  Permission is granted to anyone to use this software for any purpose,
    1.13 +  including commercial applications, and to alter it and redistribute it
    1.14 +  freely, subject to the following restrictions:
    1.15 +
    1.16 +  1. The origin of this software must not be misrepresented; you must not
    1.17 +     claim that you wrote the original software. If you use this software
    1.18 +     in a product, an acknowledgment in the product documentation would be
    1.19 +     appreciated but is not required.
    1.20 +  2. Altered source versions must be plainly marked as such, and must not be
    1.21 +     misrepresented as being the original software.
    1.22 +  3. This notice may not be removed or altered from any source distribution.
    1.23 +*/
    1.24 +#include "../../SDL_internal.h"
    1.25 +
    1.26 +#ifndef _SDL_windowshaptic_c_h
    1.27 +#define _SDL_windowshaptic_c_h
    1.28 +
    1.29 +#include "SDL_thread.h"
    1.30 +
    1.31 +#include "../../core/windows/SDL_directx.h"
    1.32 +#include "../../core/windows/SDL_xinput.h"
    1.33 +
    1.34 +/*
    1.35 + * Haptic system hardware data.
    1.36 + */
    1.37 +struct haptic_hwdata
    1.38 +{
    1.39 +#if SDL_HAPTIC_DINPUT
    1.40 +    LPDIRECTINPUTDEVICE8 device;
    1.41 +#endif
    1.42 +    DWORD axes[3];              /* Axes to use. */
    1.43 +    SDL_bool is_joystick;       /* Device is loaded as joystick. */
    1.44 +    Uint8 bXInputHaptic; /* Supports force feedback via XInput. */
    1.45 +    Uint8 userid; /* XInput userid index for this joystick */
    1.46 +    SDL_Thread *thread;
    1.47 +    SDL_mutex *mutex;
    1.48 +    volatile Uint32 stopTicks;
    1.49 +    volatile int stopThread;
    1.50 +};
    1.51 +
    1.52 +
    1.53 +/*
    1.54 + * Haptic system effect data.
    1.55 + */
    1.56 +struct haptic_hweffect
    1.57 +{
    1.58 +#if SDL_HAPTIC_DINPUT
    1.59 +    DIEFFECT effect;
    1.60 +    LPDIRECTINPUTEFFECT ref;
    1.61 +#endif
    1.62 +#if SDL_HAPTIC_XINPUT
    1.63 +    XINPUT_VIBRATION vibration;
    1.64 +#endif
    1.65 +};
    1.66 +
    1.67 +/*
    1.68 +* List of available haptic devices.
    1.69 +*/
    1.70 +typedef struct SDL_hapticlist_item
    1.71 +{
    1.72 +    char *name;
    1.73 +    SDL_Haptic *haptic;
    1.74 +#if SDL_HAPTIC_DINPUT
    1.75 +    DIDEVICEINSTANCE instance;
    1.76 +    DIDEVCAPS capabilities;
    1.77 +#endif
    1.78 +    SDL_bool bXInputHaptic; /* Supports force feedback via XInput. */
    1.79 +    Uint8 userid; /* XInput userid index for this joystick */
    1.80 +    struct SDL_hapticlist_item *next;
    1.81 +} SDL_hapticlist_item;
    1.82 +
    1.83 +extern SDL_hapticlist_item *SDL_hapticlist;
    1.84 +
    1.85 +extern int SDL_SYS_AddHapticDevice(SDL_hapticlist_item *item);
    1.86 +extern int SDL_SYS_RemoveHapticDevice(SDL_hapticlist_item *prev, SDL_hapticlist_item *item);
    1.87 +
    1.88 +#endif /* _SDL_windowshaptic_c_h */
    1.89 +
    1.90 +/* vi: set ts=4 sw=4 expandtab: */
    1.91 +