From 4d545b9ad859c8849be62eac2f9962a1f184daa5 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 27 Nov 2020 00:20:27 +0900 Subject: [PATCH] ebiten: Skip calling Draw when the update count is 0 --- uicontext.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/uicontext.go b/uicontext.go index 221baf850..de87e02fa 100644 --- a/uicontext.go +++ b/uicontext.go @@ -176,10 +176,12 @@ func (c *uiContext) update() error { c.updateOffscreen() - if IsScreenClearedEveryFrame() { - c.offscreen.Clear() + if updateCount > 0 { + 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()