mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +01:00
Bug fix: Add gopherjs:blocking for the latest GopherJS
This commit is contained in:
parent
249add3979
commit
fdedee9aab
@ -28,6 +28,7 @@ const bufferSize = 1024
|
|||||||
|
|
||||||
func audioProcess(channel int) func(e js.Object) {
|
func audioProcess(channel int) func(e js.Object) {
|
||||||
return func(e js.Object) {
|
return func(e js.Object) {
|
||||||
|
go func() {
|
||||||
defer func() {
|
defer func() {
|
||||||
currentPosition += bufferSize
|
currentPosition += bufferSize
|
||||||
}()
|
}()
|
||||||
@ -46,6 +47,7 @@ func audioProcess(channel int) func(e js.Object) {
|
|||||||
l.SetIndex(i, float64(inputL[i])/max)
|
l.SetIndex(i, float64(inputL[i])/max)
|
||||||
r.SetIndex(i, float64(inputR[i])/max)
|
r.SetIndex(i, float64(inputR[i])/max)
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
run.go
3
run.go
@ -79,7 +79,8 @@ func Run(f func(*Image) error, width, height, scale int, title string) error {
|
|||||||
if err := graphicsContext.preUpdate(); err != nil {
|
if err := graphicsContext.preUpdate(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := f(graphicsContext.screen); err != nil {
|
err := f(graphicsContext.screen) //gopherjs:blocking
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := graphicsContext.postUpdate(); err != nil {
|
if err := graphicsContext.postUpdate(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user