Skip to content

finite_gamepad_init

The finite_gamepad_init function creates a FiniteGamepad

bool finite_gamepad_init(FiniteShell *shell)
TypeDescription
FiniteShell *shellThe FiniteShell the gamepad is connected to.
bool withGP = finite_gamepad_init(myShell);
myShell->canHomeMenu = false;
if (!withGP) {
FINITE_LOG_ERROR("Can't poll controller data");
}

finite_gamepad_init returns false only if the program is unable to search for gamepads. If no gamepads are connected, FiniteShell.gamepadAvailable will be false. Developers should verify a controller is available before doing anything controller intensive.