diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 96ea367dc..342336142 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -624,6 +624,13 @@ int SetGamepadMappings(const char *mappings) return 0; } +// Get gamepad GUID +const char *GetGamepadGUID(int gamepad) +{ + TRACELOG(LOG_WARNING, "GetGamepadGUID() not implemented on target platform"); + return ""; +} + // Set gamepad vibration void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 9159b302a..4ae29acec 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1084,6 +1084,12 @@ int SetGamepadMappings(const char *mappings) return glfwUpdateGamepadMappings(mappings); } +// Get gamepad GUID +const char *GetGamepadGUID(int gamepad) +{ + return glfwGetJoystickGUID(gamepad); +} + // Set gamepad vibration void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index 710b05f39..69912e913 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -789,6 +789,13 @@ int SetGamepadMappings(const char *mappings) return 0; } +// Get gamepad GUID +const char *GetGamepadGUID(int gamepad) +{ + TRACELOG(LOG_WARNING, "GetGamepadGUID() not implemented on target platform"); + return ""; +} + // Set gamepad vibration void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index f248e2614..3e33b4bee 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -1236,6 +1236,13 @@ int SetGamepadMappings(const char *mappings) return SDL_GameControllerAddMapping(mappings); } +// Get gamepad GUID +const char *GetGamepadGUID(int gamepad) +{ + TRACELOG(LOG_WARNING, "GetGamepadGUID() not implemented on target platform"); + return ""; +} + // Set gamepad vibration void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index 36d255bc0..d6fa5f218 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -619,6 +619,13 @@ int SetGamepadMappings(const char *mappings) return 0; } +// Get gamepad GUID +const char *GetGamepadGUID(int gamepad) +{ + TRACELOG(LOG_WARNING, "GetGamepadGUID() not implemented on target platform"); + return ""; +} + // Set gamepad vibration void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index c532bf24f..cc559823f 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -381,6 +381,13 @@ int SetGamepadMappings(const char *mappings) return 0; } +// Get gamepad GUID +const char *GetGamepadGUID(int gamepad) +{ + TRACELOG(LOG_WARNING, "GetGamepadGUID() not implemented on target platform"); + return ""; +} + // Set gamepad vibration void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index 07f6f79ba..c2208f9d8 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -162,13 +162,13 @@ bool WindowShouldClose(void) // REF: https://emscripten.org/docs/porting/asyncify.html // WindowShouldClose() is not called on a web-ready raylib application if using emscripten_set_main_loop() - // and encapsulating one frame execution on a UpdateDrawFrame() function, + // and encapsulating one frame execution on a UpdateDrawFrame() function, // allowing the browser to manage execution asynchronously // Optionally we can manage the time we give-control-back-to-browser if required, // but it seems below line could generate stuttering on some browsers emscripten_sleep(12); - + return false; } @@ -914,6 +914,13 @@ int SetGamepadMappings(const char *mappings) return 0; } +// Get gamepad GUID +const char *GetGamepadGUID(int gamepad) +{ + TRACELOG(LOG_WARNING, "GetGamepadGUID() not implemented on target platform"); + return ""; +} + // Set gamepad vibration void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration) { diff --git a/src/raylib.h b/src/raylib.h index b8428e7ac..65d1f04e6 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1195,6 +1195,7 @@ RLAPI int GetGamepadButtonPressed(void); // Get the last ga RLAPI int GetGamepadAxisCount(int gamepad); // Get gamepad axis count for a gamepad RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Get axis movement value for a gamepad axis RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) +RLAPI const char *GetGamepadGUID(int gamepad); // Get gamepad GUID RLAPI void SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration); // Set gamepad vibration for both motors (duration in seconds) // Input-related functions: mouse