progress implementing SML-side handling of controller

This commit is contained in:
2026-01-20 07:10:15 +00:00
parent f2bffc4b6b
commit 73d30bfb1f
5 changed files with 126 additions and 32 deletions

View File

@@ -45,9 +45,12 @@ GLFWgamepadstate state;
float* axes;
int axesCount = -1;
void getGamepadState(int joystickID) {
if (glfwGetGamepadState(joystickID, &state)) {
int getGamepadState(int joystickID) {
if (glfwJoystickIsGamepad(joystickID) && glfwGetGamepadState(joystickID, &state)) {
axes = glfwGetJoystickAxes(joystickID, &axesCount);
return 1;
} else {
return 0;
}
}