From c6cd672536f7792ba44ed28ed5cb97e6ebd0033c Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 19 Mar 2018 03:16:52 +0900 Subject: [PATCH] examples/contextlost: Extend the shared backend texture on purpose --- examples/contextlost/main.go | 7 +++++++ 1 file changed, 7 insertions(+) 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) }