gorbit99 / olcPGEX_Gamepad

Cross platform (Windows + Linux) Gamepad API for the Pixel Game Engine (http://onelonecoder.com/)
Other
15 stars 5 forks source link

Vibrate on DualShock4 #11

Open UKTailwind opened 9 months ago

UKTailwind commented 9 months ago

Vibrate is not working for me on a DualShock4, is this to be expected or is it me? The routine I'm using is below and this is called just after I read the analogue values and the buttons which works perfectly. Vibrate is a float between 0.0 and 1.0 and prints when changed as expected so I know the routine is being called.

if (vibrate!= lastvibrate) {
    printf("%f", vibrate);
    lastvibrate = vibrate;
    if(vibrate>0.0)gamepad->startVibration(vibrate);
    else gamepad->stopVibration();
}
gorbit99 commented 9 months ago

Truth be told, I don't have a DS4 on hand right now to test. But is this on windows or linux or what system exactly?

UKTailwind commented 9 months ago

Sorry - should have said W11.