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.
This commit is contained in:
Hajime Hoshi 2022-02-04 22:46:12 +09:00
parent 577b4eed0d
commit ee1b5e2044
2 changed files with 1 additions and 4 deletions

View File

@ -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) {

2
run.go
View File

@ -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
)