First attempt to fix compilation on windows. gsoc2008_force_feedback
authorEdgar Simo <bobbens@gmail.com>
Thu, 31 Jul 2008 15:57:49 +0000
branchgsoc2008_force_feedback
changeset 25685ad98a77bacb
parent 2567 d551e29f086b
child 2569 806919b319d4
First attempt to fix compilation on windows.
src/haptic/win32/SDL_syshaptic.c
     1.1 --- a/src/haptic/win32/SDL_syshaptic.c	Thu Jul 31 11:10:52 2008 +0000
     1.2 +++ b/src/haptic/win32/SDL_syshaptic.c	Thu Jul 31 15:57:49 2008 +0000
     1.3 @@ -84,6 +84,13 @@
     1.4  
     1.5  
     1.6  /*
     1.7 + * External stuff.
     1.8 + */
     1.9 +extern HINSTANCE SDL_Instance;
    1.10 +extern HWND SDL_Window;
    1.11 +
    1.12 +
    1.13 +/*
    1.14   * Prototypes.
    1.15   */
    1.16  static BOOL CALLBACK EnumHapticsCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext);
    1.17 @@ -141,8 +148,8 @@
    1.18  
    1.19     /* Look for haptic devices. */
    1.20     ret = IDirectInput_EnumDevices( dinput,
    1.21 -                                   DIDEVTYPE_ALL,
    1.22 -                                   EnumJoysticksCallback,
    1.23 +                                   DIDEVTYPE_DEVICE,
    1.24 +                                   EnumHapticsCallback,
    1.25                                     NULL, DIEDFL_FORCEFEEDBACK | DIEDFL_ATTACHEDONLY);
    1.26     if (FAILED(ret)) {
    1.27        DI_SetError("Enumerating DirectInput devices",ret);
    1.28 @@ -183,7 +190,7 @@
    1.29   * Callback to get all supported effects.
    1.30   */
    1.31  #define EFFECT_TEST(e,s)   \
    1.32 -if (pei->guid == (e))   \
    1.33 +if (pei->guid == (e))      \
    1.34     haptic->supported |= (s)
    1.35  static BOOL CALLBACK
    1.36  DI_EffectCallback(LPCDIEffectInfo pei, LPVOID pv)
    1.37 @@ -240,7 +247,7 @@
    1.38    
    1.39     /* Open the device */
    1.40     ret = IDirectInput_CreateDevice( dinput, &instance,
    1.41 -                                    guidInstance, &device, NULL);
    1.42 +                                    guidInstance, &device );
    1.43     if (FAILED(ret)) {
    1.44        DI_SetError("Creating DirectInput device",ret);
    1.45        goto creat_err;
    1.46 @@ -249,7 +256,7 @@
    1.47     /* Now get the IDirectInputDevice2 interface, instead. */
    1.48     ret = IDirectInputDevice_QueryInterface( device,
    1.49                                              &IID_IDirectInputDevice2,
    1.50 -                                            haptic->hwdata->device );
    1.51 +                                            (LPVOID *) &haptic->hwdata->device );
    1.52     /* Done with the temporary one now. */
    1.53     IDirectInputDevice_Release(device);
    1.54     if (FAILED(ret)) {
    1.55 @@ -301,7 +308,8 @@
    1.56  
    1.57  
    1.58     /* Get supported effects. */
    1.59 -   ret = IDirectInput_EnumEffects( DI_EffectCallback, haptic, DIEFT_ALL);
    1.60 +   ret = IDirectInputDevice2_EnumEffects( haptic->hwdata->device, 
    1.61 +                                          DI_EffectCallback, haptic, DIEFT_ALL );
    1.62     if (FAILED(ret)) {
    1.63        DI_SetError("Enumerating supported effects",ret);
    1.64        goto acquire_err;