Fixed example doesn't show gamepad for Xbox 360 controllers with different drivers (#1597)

This commit is contained in:
Rabia Alhaffar 2021-02-18 22:52:39 +02:00 committed by GitHub
parent 0f5aab3a1c
commit d96b422809
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,6 +23,7 @@
#define PS3_NAME_ID "PLAYSTATION(R)3 Controller"
#else
#define XBOX360_NAME_ID "Xbox 360 Controller"
#define XBOX360_LEGACY_NAME_ID "Xbox Controller"
#define PS3_NAME_ID "PLAYSTATION(R)3 Controller"
#endif
@ -61,7 +62,7 @@ int main(void)
{
DrawText(TextFormat("GP1: %s", GetGamepadName(GAMEPAD_PLAYER1)), 10, 10, 10, BLACK);
if (IsGamepadName(GAMEPAD_PLAYER1, XBOX360_NAME_ID))
if (IsGamepadName(GAMEPAD_PLAYER1, XBOX360_NAME_ID) || IsGamepadName(GAMEPAD_PLAYER1, XBOX360_LEGACY_NAME_ID))
{
DrawTexture(texXboxPad, 0, 0, DARKGRAY);