examples/windowsize: Bug fix: Nothing was rendered with -legacy mode

This commit is contained in:
Hajime Hoshi 2020-03-31 02:22:21 +09:00
parent 35eb9e77a0
commit b470dace1a

View File

@ -415,7 +415,17 @@ func main() {
const title = "Window Size (Ebiten Demo)" const title = "Window Size (Ebiten Demo)"
if *flagLegacy { if *flagLegacy {
if err := ebiten.Run(g.Update, g.width, g.height, initScreenScale, title); err != nil { update := func(screen *ebiten.Image) error {
if err := g.Update(screen); err != nil {
return err
}
if ebiten.IsDrawingSkipped() {
return nil
}
g.Draw(screen)
return nil
}
if err := ebiten.Run(update, g.width, g.height, initScreenScale, title); err != nil {
log.Fatal(err) log.Fatal(err)
} }
} else { } else {