SDL_RumbleGamepad(3)
π SDL_RumbleGamepad π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_RumbleGamepad β she makes your gamepad go brrrrr π
β¨ NAME β¨
SDL_RumbleGamepad β Start a rumble effect on a gamepad. that's it, that's the vibe π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_gamepad.h>
bool SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
π¦ DESCRIPTION π¦
so here's the tea β every single call to this function cancels any previous rumble effect β like, no stacking, no layering, the new one just replaces the old one, periodt. and if you call it with an intensity of 0, that stops any rumbling entirely. bye bye buzz π
also important, bestie: this function requires you to process SDL events or call SDL_UpdateJoysticks() to actually update the rumble state. like, it's not gonna magically keep vibrating on its own, you gotta do your part π₯
π FUNCTION PARAMETERS π
gamepadβ the gamepad you wanna vibrate. the one getting the shimmy β¨low_frequency_rumbleβ the intensity of the low frequency (left) rumble motor, from0to0xFFFF. that's the deep, rumbly one π§high_frequency_rumbleβ the intensity of the high frequency (right) rumble motor, from0to0xFFFF. that's the buzzy, tingly one πduration_msβ the duration of the rumble effect, in milliseconds. how long she goes brrr β
π RETURN VALUE π
returns true on success or false on failure. and if it fails? call SDL_GetError() for more information, she'll tell you what went wrong π
π₯ THREAD SAFETY π₯
It is safe to call this function from any thread. go off, multithreaded queen π
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on something older... no rumble for you, sorry bestie π
that's the whole page!! now go make something shake πβ¨
kisses from the Simple Directmedia Layer girlies β this is SDL 3.4.18, and the page you just read was SDL_RumbleGamepad(3) ππ«Άπ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms