From ee1b5e2044ace0e997b6fc71490fa8650bf0f862 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 4 Feb 2022 22:46:12 +0900 Subject: [PATCH] internal/uidriver/mobile: stop requesting a frame on gamepads In general, it is impossible to treat gamepad inputtings as events. With FPSModeVsyncOffMinimum, the application cannot update with gamepad inputtings. --- internal/uidriver/mobile/gamepad_android.go | 3 --- run.go | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/uidriver/mobile/gamepad_android.go b/internal/uidriver/mobile/gamepad_android.go index 76fe7b9b9..b6de1b7a9 100644 --- a/internal/uidriver/mobile/gamepad_android.go +++ b/internal/uidriver/mobile/gamepad_android.go @@ -22,9 +22,6 @@ import ( // UpdateGamepads is called when the gamepad states are given from outside like Android. func (u *UserInterface) UpdateGamepads(gamepads []Gamepad) { u.input.updateGamepadsFromOutside(gamepads) - if u.fpsMode == driver.FPSModeVsyncOffMinimum { - u.renderRequester.RequestRenderIfNeeded() - } } func (i *Input) updateGamepadsFromOutside(gamepads []Gamepad) { diff --git a/run.go b/run.go index 5b6b86d7a..25603973f 100644 --- a/run.go +++ b/run.go @@ -362,7 +362,7 @@ const ( // FPSModeVsyncOffMinimum is useful for relatively static applications to save battery power. // // In FPSModeVsyncOffMinimum, the game's Update and Draw are called only when - // 1) new inputting is detected, or 2) ScheduleFrame is called. + // 1) new inputting except for gamepads is detected, or 2) ScheduleFrame is called. // In FPSModeVsyncOffMinimum, TPS is SyncWithFPS no matter what TPS is specified at SetMaxTPS. FPSModeVsyncOffMinimum FPSModeType = driver.FPSModeVsyncOffMinimum )