src/haptic/win32/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2590 a4410ff43f41
parent 2589 1154ad945d94
child 2591 07a19c1cc0a7
equal deleted inserted replaced
2589:1154ad945d94 2590:a4410ff43f41
   228  *       - Open temporary DirectInputDevice interface.
   228  *       - Open temporary DirectInputDevice interface.
   229  *       - Create DirectInputDevice2 interface.
   229  *       - Create DirectInputDevice2 interface.
   230  *       - Release DirectInputDevice interface.
   230  *       - Release DirectInputDevice interface.
   231  *       - Set cooperative level.
   231  *       - Set cooperative level.
   232  *       - Set data format.
   232  *       - Set data format.
       
   233  *       - Get capabilities.
   233  *       - Acquire exclusiveness.
   234  *       - Acquire exclusiveness.
   234  *       - Reset actuators.
   235  *       - Reset actuators.
   235  *       - Get supported featuers.
   236  *       - Get supported featuers.
   236  */
   237  */
   237 static int
   238 static int
   284    if (FAILED(ret)) {
   285    if (FAILED(ret)) {
   285       DI_SetError("Setting data format",ret);
   286       DI_SetError("Setting data format",ret);
   286       goto query_err;
   287       goto query_err;
   287    }
   288    }
   288 
   289 
       
   290    /* Get capabilities. */
       
   291    ret = IDirectInputDevice2_GetCapabilities( haptic->hwdata->device,
       
   292                                               &haptic->hwdata->capabilities );
       
   293    if (FAILED(ret)) {
       
   294       DI_SetError("Getting device capabilities",ret);
       
   295       goto acquire_err;
       
   296    }
       
   297 
   289    /* Acquire the device. */
   298    /* Acquire the device. */
   290    ret = IDirectInputDevice2_Acquire(haptic->hwdata->device);
   299    ret = IDirectInputDevice2_Acquire(haptic->hwdata->device);
   291    if (FAILED(ret)) {
   300    if (FAILED(ret)) {
   292       DI_SetError("Acquiring DirectInput device",ret);
   301       DI_SetError("Acquiring DirectInput device",ret);
   293       goto query_err;
   302       goto query_err;
   307                                                        DISFFC_SETACTUATORSON );
   316                                                        DISFFC_SETACTUATORSON );
   308    if (FAILED(ret)) {
   317    if (FAILED(ret)) {
   309       DI_SetError("Enabling actuators",ret);
   318       DI_SetError("Enabling actuators",ret);
   310       goto acquire_err;
   319       goto acquire_err;
   311    }
   320    }
   312 
       
   313 
       
   314    /* Get capabilities. */
       
   315    ret = IDirectInputDevice2_GetCapabilities( haptic->hwdata->device,
       
   316                                               &haptic->hwdata->capabilities );
       
   317    if (FAILED(ret)) {
       
   318       DI_SetError("Getting device capabilities",ret);
       
   319       goto acquire_err;
       
   320    }
       
   321 
       
   322 
   321 
   323    /* Get supported effects. */
   322    /* Get supported effects. */
   324    ret = IDirectInputDevice2_EnumEffects( haptic->hwdata->device, 
   323    ret = IDirectInputDevice2_EnumEffects( haptic->hwdata->device, 
   325                                           DI_EffectCallback, haptic, DIEFT_ALL );
   324                                           DI_EffectCallback, haptic, DIEFT_ALL );
   326    if (FAILED(ret)) {
   325    if (FAILED(ret)) {