From 9a48ad9033ec167dd8eafa8e3e9e8173b1acf363 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Fri, 3 Aug 2018 19:32:21 -0700 Subject: Allow a gamepad mapping to apply to all controllers, controllers of a particular type (i.e.e 6-button PS4 controllers) or specific controllers (based on SDL2 GUID) in addition to the controller in a certain slot --- render_sdl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'render_sdl.c') diff --git a/render_sdl.c b/render_sdl.c index ca5cce5..7168752 100755 --- a/render_sdl.c +++ b/render_sdl.c @@ -814,6 +814,17 @@ SDL_Joystick *render_get_joystick(int index) return joysticks[index]; } +char* render_joystick_type_id(int index) +{ + SDL_Joystick *stick = render_get_joystick(index); + if (!stick) { + return NULL; + } + char *guid_string = malloc(33); + SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(stick), guid_string, 33); + return guid_string; +} + SDL_GameController *render_get_controller(int index) { if (index >= MAX_JOYSTICKS) { -- cgit v1.2.3