mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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)"
|
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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user