SDL_GetHaptics(3)
π SDL_GetHaptics π
okay bestie, welcome to the SDL3 manual page for SDL_GetHaptics(3) β yes it's a real section of the SDL3 functions, and yes it's as cute as it sounds π
πΈ NAME πΈ
SDL_GetHaptics β get a list of currently connected haptic devices.
like, every rumble-y, buzz-y, shake-y controller that's plugged in right now?? this is the function that tells you about them. periodt. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_haptic.h>
SDL_HapticID * SDL_GetHaptics(int *count);
π«Ά FUNCTION PARAMETERS π«Ά
countβ a pointer that gets filled in with the number of haptic devices returned. it may beNULL. no thoughts, head empty, totally optional, she's flexible like that π
π¦ RETURN VALUE π¦
returns a 0 terminated array of haptic device instance IDs, or NULL on failure π β and if it fails, bestie, call SDL_GetError() for more info, she'll tell you what went wrong fr fr.
β οΈ and listen: that array needs to be freed with SDL_free() when you're done with it. don't just leave it lying around, that's not the vibe. free your memory, queen π
π AVAILABILITY π
this function is available since SDL 3.2.0 β (so if you're on something olderβ¦ it's giving ancient, i'm so sorry π)
π SEE ALSO π
SDL_OpenHaptic(3)β the natural next step, you found the devices, now go open one π§
mwah that's the whole page, you ate that π this came to you from Simple Directmedia Layer, version SDL 3.4.18, and it's SDL_GetHaptics(3) signing off β stay haptic, stay hydrated πβ¨
π¦ 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