diff --git a/uicontext.go b/uicontext.go index 4738243b1..3e8e1c0e2 100644 --- a/uicontext.go +++ b/uicontext.go @@ -190,13 +190,16 @@ func (c *uiContext) update(updateCount int) error { uiDriver().ResetForFrame() } - // Even though updateCount == 0, the offscreen is cleared and Draw is called. + // Even though updateCount == 0 and vsync is enabled, 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. - if IsScreenClearedEveryFrame() { - c.offscreen.Clear() + // 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) } - c.game.Draw(c.offscreen) // This clear is needed for fullscreen mode or some mobile platforms (#622). c.screen.Clear()