mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
examples/windowsize: Bug fix: Nothing was rendered with -legacy mode
This commit is contained in:
parent
35eb9e77a0
commit
b470dace1a
@ -415,7 +415,17 @@ func main() {
|
||||
|
||||
const title = "Window Size (Ebiten Demo)"
|
||||
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)
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user