Improvement for bug 3446 - The haptic API does not allow to select the direction axes
meyraud705
I see how the documentation is confusing. I think that the choice of the axis is an implementation detail. The documentation should state the goal of this value, so I propose this wording:
"Use this value to play an effect on the steering wheel axis. This provides
better compatibility across platforms and devices as SDL will guess the
correct axis."
Value could even be renamed 'SDL_HAPTIC_STEERING_AXIS'.
For Linux, sending an effect on the X axis with a Logitech wheel works. Others brands don't have driver for Linux as far as I know.
This commit is contained in:
1 parent
11723411ab
commit
65ad45340d
4 files changed
+10
-19
No files matched your search
@@ -765,7 +765,7 @@ SDL_SYS_SetDirection(FFEFFECT * effect, SDL_HapticDirection * dir, int naxes)
|
||||
rglDir[2] = dir->dir[2];
|
||||
}
|
||||
return 0;
|
||||
case SDL_HAPTIC_FIRST_AXIS:
|
||||
case SDL_HAPTIC_STEERING_AXIS:
|
||||
effect->dwFlags |= FFEFF_CARTESIAN;
|
||||
rglDir[0] = 0;
|
||||
return 0;
|
||||
@@ -817,7 +817,7 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src)
|
||||
envelope->dwSize = sizeof(FFENVELOPE); /* Always should be this. */
|
||||
|
||||
/* Axes. */
|
||||
if (src->constant.direction.type == SDL_HAPTIC_FIRST_AXIS) {
|
||||
if (src->constant.direction.type == SDL_HAPTIC_STEERING_AXIS) {
|
||||
dest->cAxes = 1;
|
||||
} else {
|
||||
dest->cAxes = haptic->naxes;
|
||||
|
||||
@@ -718,7 +718,7 @@ SDL_SYS_ToDirection(Uint16 *dest, SDL_HapticDirection * src)
|
||||
*dest = (Uint16) tmp;
|
||||
}
|
||||
break;
|
||||
case SDL_HAPTIC_FIRST_AXIS:
|
||||
case SDL_HAPTIC_STEERING_AXIS:
|
||||
*dest = 0x4000;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -589,7 +589,7 @@ SDL_SYS_SetDirection(DIEFFECT * effect, SDL_HapticDirection * dir, int naxes)
|
||||
if (naxes > 2)
|
||||
rglDir[2] = dir->dir[2];
|
||||
return 0;
|
||||
case SDL_HAPTIC_FIRST_AXIS:
|
||||
case SDL_HAPTIC_STEERING_AXIS:
|
||||
effect->dwFlags |= DIEFF_CARTESIAN;
|
||||
rglDir[0] = 0;
|
||||
return 0;
|
||||
@@ -641,7 +641,7 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest,
|
||||
envelope->dwSize = sizeof(DIENVELOPE); /* Always should be this. */
|
||||
|
||||
/* Axes. */
|
||||
if (src->constant.direction.type == SDL_HAPTIC_FIRST_AXIS) {
|
||||
if (src->constant.direction.type == SDL_HAPTIC_STEERING_AXIS) {
|
||||
dest->cAxes = 1;
|
||||
} else {
|
||||
dest->cAxes = haptic->naxes;
|
||||
|
||||
Reference in new issue
Block a user