mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/ui: refactoring
This commit is contained in:
parent
e5b9569142
commit
4d89b5de07
@ -90,7 +90,7 @@ func (u *userInterfaceImpl) Update() error {
|
|||||||
cancel()
|
cancel()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
_ = u.t.Loop(ctx)
|
_ = u.renderThread.Loop(ctx)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ type userInterfaceImpl struct {
|
|||||||
fpsMode FPSModeType
|
fpsMode FPSModeType
|
||||||
renderRequester RenderRequester
|
renderRequester RenderRequester
|
||||||
|
|
||||||
t *thread.OSThread
|
renderThread *thread.OSThread
|
||||||
|
|
||||||
m sync.RWMutex
|
m sync.RWMutex
|
||||||
}
|
}
|
||||||
@ -280,8 +280,8 @@ func (u *userInterfaceImpl) run(game Game, mainloop bool, options *RunOptions) (
|
|||||||
// gl.Context so that they are called on the appropriate thread.
|
// gl.Context so that they are called on the appropriate thread.
|
||||||
mgl = <-glContextCh
|
mgl = <-glContextCh
|
||||||
} else {
|
} else {
|
||||||
u.t = thread.NewOSThread()
|
u.renderThread = thread.NewOSThread()
|
||||||
graphicscommand.SetRenderingThread(u.t)
|
graphicscommand.SetRenderingThread(u.renderThread)
|
||||||
}
|
}
|
||||||
|
|
||||||
g, err := newGraphicsDriver(&graphicsDriverCreatorImpl{
|
g, err := newGraphicsDriver(&graphicsDriverCreatorImpl{
|
||||||
|
Loading…
Reference in New Issue
Block a user