|
|
@ -59,7 +59,7 @@ int main(void) |
|
|
|
|
|
|
|
if (IsGamepadAvailable(GAMEPAD_PLAYER1)) |
|
|
|
{ |
|
|
|
DrawText(FormatText("GP1: %s", GetGamepadName(GAMEPAD_PLAYER1)), 10, 10, 10, BLACK); |
|
|
|
DrawText(TextFormat("GP1: %s", GetGamepadName(GAMEPAD_PLAYER1)), 10, 10, 10, BLACK); |
|
|
|
|
|
|
|
if (IsGamepadName(GAMEPAD_PLAYER1, XBOX360_NAME_ID)) |
|
|
|
{ |
|
|
@ -106,8 +106,8 @@ int main(void) |
|
|
|
DrawRectangle(170, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_TRIGGER))/2.0f)*70), RED); |
|
|
|
DrawRectangle(604, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER))/2.0f)*70), RED); |
|
|
|
|
|
|
|
//DrawText(FormatText("Xbox axis LT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK); |
|
|
|
//DrawText(FormatText("Xbox axis RT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK); |
|
|
|
//DrawText(TextFormat("Xbox axis LT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK); |
|
|
|
//DrawText(TextFormat("Xbox axis RT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK); |
|
|
|
} |
|
|
|
else if (IsGamepadName(GAMEPAD_PLAYER1, PS3_NAME_ID)) |
|
|
|
{ |
|
|
@ -161,14 +161,14 @@ int main(void) |
|
|
|
// TODO: Draw generic gamepad |
|
|
|
} |
|
|
|
|
|
|
|
DrawText(FormatText("DETECTED AXIS [%i]:", GetGamepadAxisCount(GAMEPAD_PLAYER1)), 10, 50, 10, MAROON); |
|
|
|
DrawText(TextFormat("DETECTED AXIS [%i]:", GetGamepadAxisCount(GAMEPAD_PLAYER1)), 10, 50, 10, MAROON); |
|
|
|
|
|
|
|
for (int i = 0; i < GetGamepadAxisCount(GAMEPAD_PLAYER1); i++) |
|
|
|
{ |
|
|
|
DrawText(FormatText("AXIS %i: %.02f", i, GetGamepadAxisMovement(GAMEPAD_PLAYER1, i)), 20, 70 + 20*i, 10, DARKGRAY); |
|
|
|
DrawText(TextFormat("AXIS %i: %.02f", i, GetGamepadAxisMovement(GAMEPAD_PLAYER1, i)), 20, 70 + 20*i, 10, DARKGRAY); |
|
|
|
} |
|
|
|
|
|
|
|
if (GetGamepadButtonPressed() != -1) DrawText(FormatText("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED); |
|
|
|
if (GetGamepadButtonPressed() != -1) DrawText(TextFormat("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED); |
|
|
|
else DrawText("DETECTED BUTTON: NONE", 10, 430, 10, GRAY); |
|
|
|
} |
|
|
|
else |
|
|
|