From a4f6909710d974d42e7f72b65c55e910f7fac2b1 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 1 Apr 2020 03:38:32 +0900 Subject: [PATCH] ui: Add comments --- uicontext.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/uicontext.go b/uicontext.go index ae9ce0910..6256ce0b2 100644 --- a/uicontext.go +++ b/uicontext.go @@ -266,7 +266,13 @@ func (c *uiContext) update(afterFrameUpdate func()) error { for i := 0; i < updateCount; i++ { c.updateOffscreen() - // When Draw exists, rendering should be always skipped. + // When the game's Draw exists, rendering should be always skipped. + // + // When the game's Draw does not exist, the last Update call should process drawing. + // This assumes that (*uiContext).Update and (*uiContext).Draw are called successively. + // + // TODO: Make (Game).Draw mandatory and remove this assumption when we can update the major version. + // Move the clock usage to the UI driver side. setDrawingSkipped(hasDraw || i < updateCount-1) if err := hooks.RunBeforeUpdateHooks(); err != nil {