(feat): Add option to set max FPS (#578)

* (feat): add option for setting FPS on renderer

Co-authored-by: Christian Rocha <christian@rocha.is>
This commit is contained in:
tomfeigin
2023-06-06 18:49:11 +03:00
committed by GitHub
parent 44f17fa1c0
commit f3e1b67605
3 changed files with 23 additions and 4 deletions

View File

@@ -200,3 +200,12 @@ func WithFilter(filter func(Model, Msg) Msg) ProgramOption {
p.filter = filter
}
}
// WithMaxFPS sets a custom maximum FPS at which the renderer should run. If
// less than 1, the default value of 60 will be used. If over 120, the FPS
// will be capped at 120.
func WithFPS(fps int) ProgramOption {
return func(p *Program) {
p.fps = fps
}
}