The example always showed a xbox controller, never a ps3 controller (#4040)

This commit is contained in:
Konrad Gutvik Grande 2024-06-07 10:21:02 +02:00 committed by GitHub
parent f05316b11d
commit 3948656d84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@
// NOTE: Gamepad name ID depends on drivers and OS
#define XBOX360_LEGACY_NAME_ID "Xbox Controller"
#define XBOX360_NAME_ID "Xbox 360 Controller"
#define PS3_NAME_ID "PLAYSTATION(R)3 Controller"
#define PS3_NAME_ID "Sony PLAYSTATION(R)3 Controller"
//------------------------------------------------------------------------------------
// Program main entry point
@ -67,7 +67,7 @@ int main(void)
{
DrawText(TextFormat("GP%d: %s", gamepad, GetGamepadName(gamepad)), 10, 10, 10, BLACK);
if (true)
if (TextIsEqual(GetGamepadName(gamepad), XBOX360_LEGACY_NAME_ID) || TextIsEqual(GetGamepadName(gamepad), XBOX360_NAME_ID))
{
DrawTexture(texXboxPad, 0, 0, DARKGRAY);