Use SDL_GameControllerSetPlayerIndex() to indicate player index
This commit is contained in:
parent
5b4d874851
commit
9b271d918a
1 changed files with 7 additions and 0 deletions
|
|
@ -974,6 +974,13 @@ void SdlInputHandler::handleControllerDeviceEvent(SDL_ControllerDeviceEvent* eve
|
||||||
state = &m_GamepadState[i];
|
state = &m_GamepadState[i];
|
||||||
if (m_MultiController) {
|
if (m_MultiController) {
|
||||||
state->index = i;
|
state->index = i;
|
||||||
|
|
||||||
|
#if SDL_VERSION_ATLEAST(2, 0, 12)
|
||||||
|
// This will change indicators on the controller to show the assigned
|
||||||
|
// player index. For Xbox 360 controllers, that means updating the LED
|
||||||
|
// ring to light up the corresponding quadrant for this player.
|
||||||
|
SDL_GameControllerSetPlayerIndex(controller, state->index);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Always player 1 in single controller mode
|
// Always player 1 in single controller mode
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue