mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Async loading textures
This commit is contained in:
parent
cbc5c38db6
commit
8fbd818f28
@ -46,13 +46,15 @@ func main() {
|
|||||||
screenSizeUpdated := u.ScreenSizeUpdated()
|
screenSizeUpdated := u.ScreenSizeUpdated()
|
||||||
|
|
||||||
for tag, path := range TexturePaths {
|
for tag, path := range TexturePaths {
|
||||||
//go func() {
|
tag := tag
|
||||||
|
path := path
|
||||||
|
go func() {
|
||||||
img, err := loadImage(path)
|
img, err := loadImage(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
u.CreateTexture(tag, img)
|
u.CreateTexture(tag, img)
|
||||||
//}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
drawing := make(chan *graphics.LazyCanvas)
|
drawing := make(chan *graphics.LazyCanvas)
|
||||||
|
Loading…
Reference in New Issue
Block a user