Async loading textures

This commit is contained in:
Hajime Hoshi 2013-12-08 16:28:18 +09:00
parent cbc5c38db6
commit 8fbd818f28

View File

@ -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)