mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +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")
|
panic("not reached")
|
||||||
}
|
}
|
||||||
// TODO: Check this is called on the rendering thread
|
// TODO: Check this is called on the rendering thread
|
||||||
|
workAvailable := c.worker.WorkAvailable()
|
||||||
loop:
|
loop:
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case err := <-chError:
|
case err := <-chError:
|
||||||
return err
|
return err
|
||||||
case <-c.worker.WorkAvailable():
|
case <-workAvailable:
|
||||||
c.worker.DoWork()
|
c.worker.DoWork()
|
||||||
case <-chDone:
|
case <-chDone:
|
||||||
break loop
|
break loop
|
||||||
|
Loading…
Reference in New Issue
Block a user