mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
opengl: Refactoring: More similar way to golang.org/x/mobile/app
This commit is contained in:
parent
c47b549fd1
commit
c0b1919020
@ -93,12 +93,13 @@ func (c *Context) DoWork(chError <-chan error, chDone <-chan struct{}) error {
|
||||
panic("not reached")
|
||||
}
|
||||
// TODO: Check this is called on the rendering thread
|
||||
workAvailable := c.worker.WorkAvailable()
|
||||
loop:
|
||||
for {
|
||||
select {
|
||||
case err := <-chError:
|
||||
return err
|
||||
case <-c.worker.WorkAvailable():
|
||||
case <-workAvailable:
|
||||
c.worker.DoWork()
|
||||
case <-chDone:
|
||||
break loop
|
||||
|
Loading…
Reference in New Issue
Block a user