mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +01:00
uidriver/mobile: Refactoring
This commit is contained in:
parent
f332fa61c1
commit
8336cb6007
@ -88,12 +88,6 @@ func (u *UserInterface) Update() error {
|
|||||||
panic("mobile: glWorker must be initialized but not")
|
panic("mobile: glWorker must be initialized but not")
|
||||||
}
|
}
|
||||||
|
|
||||||
done := make(chan struct{})
|
|
||||||
go func() {
|
|
||||||
<-renderEndCh
|
|
||||||
close(done)
|
|
||||||
}()
|
|
||||||
|
|
||||||
workAvailable := u.glWorker.WorkAvailable()
|
workAvailable := u.glWorker.WorkAvailable()
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
@ -104,7 +98,7 @@ func (u *UserInterface) Update() error {
|
|||||||
// Apprently there is an issue in the usage of Worker in gomobile or gomobile itself.
|
// Apprently there is an issue in the usage of Worker in gomobile or gomobile itself.
|
||||||
// At least, freezing doesn't happen with this Gosched.
|
// At least, freezing doesn't happen with this Gosched.
|
||||||
runtime.Gosched()
|
runtime.Gosched()
|
||||||
case <-done:
|
case <-renderEndCh:
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user