mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
ui: Bug fix: 'frames' should be incremanted only when drawing happens
This commit is contained in:
parent
5fa81ebe78
commit
328900ec80
2
run.go
2
run.go
@ -214,10 +214,10 @@ func Run(f func(*Image) error, width, height, scale int, title string) error {
|
|||||||
}
|
}
|
||||||
ui.CurrentUI().SwapBuffers()
|
ui.CurrentUI().SwapBuffers()
|
||||||
beforeForUpdate += int64(t) * int64(time.Second/FPS)
|
beforeForUpdate += int64(t) * int64(time.Second/FPS)
|
||||||
|
frames++
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calc the current FPS.
|
// Calc the current FPS.
|
||||||
frames++
|
|
||||||
if time.Second <= time.Duration(now-beforeForFPS) {
|
if time.Second <= time.Duration(now-beforeForFPS) {
|
||||||
currentRunContext.updateFPS(float64(frames) * float64(time.Second) / float64(now-beforeForFPS))
|
currentRunContext.updateFPS(float64(frames) * float64(time.Second) / float64(now-beforeForFPS))
|
||||||
beforeForFPS = now
|
beforeForFPS = now
|
||||||
|
Loading…
Reference in New Issue
Block a user