- [NEW] Afegit soport per a gamepad en JInput
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user