Skip to content

Commit

Permalink
List the available haptic devices in testhaptic
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jun 20, 2023
1 parent 8cf5dc9 commit 6306ee9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/testhaptic.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ int main(int argc, char **argv)
/* Initialize the force feedbackness */
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK |
SDL_INIT_HAPTIC);
SDL_Log("%d Haptic devices detected.\n", SDL_NumHaptics());
SDL_Log("%d Haptic devices detected:\n", SDL_NumHaptics());
for (i = 0; i < SDL_NumHaptics(); ++i) {
SDL_Log(" %s\n", SDL_HapticName(i));
}
if (SDL_NumHaptics() > 0) {
/* We'll just use index or the first force feedback device found */
if (name == NULL) {
Expand Down

0 comments on commit 6306ee9

Please sign in to comment.