- [NEW] Afegit soport per a gamepad en JInput

This commit is contained in:
2024-10-02 13:06:25 +02:00
parent 5620fff446
commit 54667d3ebc
3 changed files with 108 additions and 0 deletions

View File

@@ -62,6 +62,12 @@ int main(int argc, char *argv[])
{
input::updateWheel(e.wheel.y);
}
if (e.type==SDL_CONTROLLERBUTTONDOWN) {
input::updatePadBtn(e.cbutton.button);
}
if (e.type==SDL_CONTROLLERBUTTONUP) {
input::updatePadBtnPressed(e.cbutton.button);
}
}
if (SDL_GetTicks()-current_ticks >= game::ticks_per_frame)
@@ -71,6 +77,8 @@ int main(int argc, char *argv[])
input::updateKeypressed(SDL_SCANCODE_UNKNOWN);
input::updateClk(0);
input::updateWheel(0);
input::updatePadBtn(SDL_CONTROLLER_BUTTON_INVALID);
input::updatePadBtnPressed(SDL_CONTROLLER_BUTTON_INVALID);
current_ticks = SDL_GetTicks();
}
}