# HG changeset patch # User Edgar Simo # Date 1217519869 0 # Node ID 5ad98a77bacbeccaac1af004dea56ce643653794 # Parent d551e29f086b95e4f38f6def3a16b6b5791cb53e First attempt to fix compilation on windows. diff -r d551e29f086b -r 5ad98a77bacb src/haptic/win32/SDL_syshaptic.c --- a/src/haptic/win32/SDL_syshaptic.c Thu Jul 31 11:10:52 2008 +0000 +++ b/src/haptic/win32/SDL_syshaptic.c Thu Jul 31 15:57:49 2008 +0000 @@ -84,6 +84,13 @@ /* + * External stuff. + */ +extern HINSTANCE SDL_Instance; +extern HWND SDL_Window; + + +/* * Prototypes. */ static BOOL CALLBACK EnumHapticsCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext); @@ -141,8 +148,8 @@ /* Look for haptic devices. */ ret = IDirectInput_EnumDevices( dinput, - DIDEVTYPE_ALL, - EnumJoysticksCallback, + DIDEVTYPE_DEVICE, + EnumHapticsCallback, NULL, DIEDFL_FORCEFEEDBACK | DIEDFL_ATTACHEDONLY); if (FAILED(ret)) { DI_SetError("Enumerating DirectInput devices",ret); @@ -183,7 +190,7 @@ * Callback to get all supported effects. */ #define EFFECT_TEST(e,s) \ -if (pei->guid == (e)) \ +if (pei->guid == (e)) \ haptic->supported |= (s) static BOOL CALLBACK DI_EffectCallback(LPCDIEffectInfo pei, LPVOID pv) @@ -240,7 +247,7 @@ /* Open the device */ ret = IDirectInput_CreateDevice( dinput, &instance, - guidInstance, &device, NULL); + guidInstance, &device ); if (FAILED(ret)) { DI_SetError("Creating DirectInput device",ret); goto creat_err; @@ -249,7 +256,7 @@ /* Now get the IDirectInputDevice2 interface, instead. */ ret = IDirectInputDevice_QueryInterface( device, &IID_IDirectInputDevice2, - haptic->hwdata->device ); + (LPVOID *) &haptic->hwdata->device ); /* Done with the temporary one now. */ IDirectInputDevice_Release(device); if (FAILED(ret)) { @@ -301,7 +308,8 @@ /* Get supported effects. */ - ret = IDirectInput_EnumEffects( DI_EffectCallback, haptic, DIEFT_ALL); + ret = IDirectInputDevice2_EnumEffects( haptic->hwdata->device, + DI_EffectCallback, haptic, DIEFT_ALL ); if (FAILED(ret)) { DI_SetError("Enumerating supported effects",ret); goto acquire_err;