Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Added SDL_HAPTIC_STATUS support to windows haptic port.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Aug 6, 2008
1 parent 188e094 commit 0b52f7f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/haptic/win32/SDL_syshaptic.c
Expand Up @@ -465,6 +465,9 @@ SDL_SYS_HapticOpenFromDevice2(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE2 device2)
haptic->supported |= SDL_HAPTIC_AUTOCENTER;
}

/* Status is always supported. */
haptic->supported |= SDL_HAPTIC_STATUS;

/* Check maximum effects. */
haptic->neffects = 128; /* TODO actually figure this out. */
haptic->nplaying = 128;
Expand Down Expand Up @@ -1231,8 +1234,17 @@ SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect * effect)
int
SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect * effect)
{
SDL_SetError("Haptic: Status not supported.");
return -1;
HRESULT ret;
DWORD status;

ret = IDirectInputEffect_GetEffectStatus(effect->hweffect->ref, &status);
if (FAILED(ret)) {
DI_SetError("Getting effect status",ret);
return -1;
}

if (status == 0) return SDL_FALSE;
return SDL_TRUE;
}


Expand Down

0 comments on commit 0b52f7f

Please sign in to comment.