From 6306ee9f421fac43891b22a417d7c5d5eb4e8b31 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 20 Jun 2023 09:33:59 -0700
Subject: [PATCH] List the available haptic devices in testhaptic
---
test/testhaptic.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/test/testhaptic.c b/test/testhaptic.c
index 0b751fc0369f..6a6d686981f6 100644
--- a/test/testhaptic.c
+++ b/test/testhaptic.c
@@ -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) {