mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
examples/contextlost: Extend the shared backend texture on purpose
This commit is contained in:
parent
96b9f09058
commit
c6cd672536
@ -40,6 +40,7 @@ const (
|
|||||||
var (
|
var (
|
||||||
count = 0
|
count = 0
|
||||||
gophersImage *ebiten.Image
|
gophersImage *ebiten.Image
|
||||||
|
extraImages []*ebiten.Image
|
||||||
)
|
)
|
||||||
|
|
||||||
func update(screen *ebiten.Image) error {
|
func update(screen *ebiten.Image) error {
|
||||||
@ -86,6 +87,12 @@ func main() {
|
|||||||
}
|
}
|
||||||
gophersImage, _ = ebiten.NewImageFromImage(img, ebiten.FilterDefault)
|
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 {
|
if err := ebiten.Run(update, screenWidth, screenHeight, 2, "Context Lost (Ebiten Demo)"); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user