diff --git a/examples/contextlost/main.go b/examples/contextlost/main.go index 44702351c..bab966763 100644 --- a/examples/contextlost/main.go +++ b/examples/contextlost/main.go @@ -40,6 +40,7 @@ const ( var ( count = 0 gophersImage *ebiten.Image + extraImages []*ebiten.Image ) func update(screen *ebiten.Image) error { @@ -86,6 +87,12 @@ func main() { } gophersImage, _ = ebiten.NewImageFromImage(img, ebiten.FilterDefault) + // Extend the shared backend GL texture on purpose. + for i := 0; i < 20; i++ { + eimg, _ := ebiten.NewImageFromImage(img, ebiten.FilterDefault) + extraImages = append(extraImages, eimg) + } + if err := ebiten.Run(update, screenWidth, screenHeight, 2, "Context Lost (Ebiten Demo)"); err != nil { log.Fatal(err) }