Skip to content

Commit

Permalink
internal/uidriver/mobile: stop requesting a frame on gamepads
Browse files Browse the repository at this point in the history
In general, it is impossible to treat gamepad inputtings as events.
With FPSModeVsyncOffMinimum, the application cannot update with
gamepad inputtings.
  • Loading branch information
hajimehoshi committed Feb 4, 2022
1 parent 577b4ee commit ee1b5e2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions internal/uidriver/mobile/gamepad_android.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit ee1b5e2

Please sign in to comment.