Fix gamepad names for PLATFORM_DESKTOP/GLFW (#3462)

This commit is contained in:
ubkp 2023-10-25 14:13:51 -03:00 committed by GitHub
parent b0c0f2e560
commit cb1c2ffda1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1536,6 +1536,12 @@ int InitPlatform(void)
glfwSetJoystickCallback(JoystickCallback);
glfwSetInputMode(platform.handle, GLFW_LOCK_KEY_MODS, GLFW_TRUE); // Enable lock keys modifiers (CAPS, NUM)
// Retrieve gamepad names
for (int i = 0; i < MAX_GAMEPADS; i++)
{
if (glfwJoystickPresent(i)) strcpy(CORE.Input.Gamepad.name[i], glfwGetJoystickName(i));
}
//----------------------------------------------------------------------------
// Initialize timming system