I tried your suggestions and printed out
SDL_HapticNumEffects which gave 1 axis respective 128 supported effect slots.
I am currently trying my software with Thrustmaster T300RS Racing Wheel but get the same problems with Logitech G25/G27/G29. OS is Windows 10.
So I tried to create only one effect, the Custom one, but still get the same error:
“Haptic error Unable to create effect”
I traced down the error message, and the call chain looks like:
int SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect);
int SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base);
int SDL_DINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base)
--> DI_SetError("Unable to create effect", ret);
I am quite sure my parameters to SDL_HapticEffect*, type = SDL_HAPTIC_CUSTOM are incorrect and results in this error, but there are no examples and the documentation is defective when it comes to the custom effect settings.
For example, why is the SDL_HapticCustom.data (Uint16*) member an unsigned value? If it is supposed to be a custom signal (as I have interpretated it), should it not be able to have negative values as well? Compare with SdlHapticPeriodic.magnitude (Sint16) which is a signed value.
Help and hints appreciated!