mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Revert "ebiten: Do not skip Draw when vsync is disabled"
This reverts commit 7dda2d8e4b
.
Reason: #1595: FPS doesn't match with the number of Draw calls per second when vsync is off.
Updates #1520
Closes #1595
This commit is contained in:
parent
dcaa1f9722
commit
7e1943dba7
11
uicontext.go
11
uicontext.go
@ -200,16 +200,13 @@ func (c *uiContext) update(updateCount int) error {
|
||||
uiDriver().ResetForFrame()
|
||||
}
|
||||
|
||||
// Even though updateCount == 0, the offscreen is cleared and Draw is called when vscync is enabled.
|
||||
// Even though updateCount == 0, the offscreen is cleared and Draw is called.
|
||||
// Draw should not update the game state and then the screen should not be updated without Update, but
|
||||
// users might want to process something at Draw with the time intervals of FPS.
|
||||
// When vsync is disabled, as performance matters, skip calling Draw when possible (#1520).
|
||||
if updateCount > 0 || IsVsyncEnabled() {
|
||||
if IsScreenClearedEveryFrame() {
|
||||
c.offscreen.Clear()
|
||||
}
|
||||
c.game.Draw(c.offscreen)
|
||||
if IsScreenClearedEveryFrame() {
|
||||
c.offscreen.Clear()
|
||||
}
|
||||
c.game.Draw(c.offscreen)
|
||||
|
||||
// This clear is needed for fullscreen mode or some mobile platforms (#622).
|
||||
c.screen.Clear()
|
||||
|
Loading…
Reference in New Issue
Block a user