final_game_tech
final_game_tech copied to clipboard
FPL_MAX_GAMEPAD_STATE_COUNT on Linux and Windows
fplGamepadStates uses a static array with size FPL_MAX_GAMEPAD_STATE_COUNT. In Windows builds it's defined as XUSER_MAX_COUNT = 4. In Liunx builds, there is FPL__LINUX_MAX_GAME_CONTROLLER_COUNT = 4;
fpl_platform_api bool fplPollGamepadStates(fplGamepadStates* outStates) checks that they are equal with fplAssert(fplArrayCount(controllersState->controllers) == fplArrayCount(outStates->deviceStates));.
But the same constant should be used for both: fpl__LinuxGameControllersState::controllers[] and fplGamepadStates::deviceStates[], because your game only has access to fplGamepadStates. If either of both changes, the game will crash on Linux, only.