graphicsdriver/opengl: Rename GetDriver -> Get

This commit is contained in:
Hajime Hoshi 2018-11-13 00:01:26 +09:00
parent 2313f79160
commit e24f6b7848
4 changed files with 7 additions and 7 deletions

View File

@ -20,5 +20,5 @@ import (
) )
func driver() graphicsdriver.GraphicsDriver { func driver() graphicsdriver.GraphicsDriver {
return opengl.GetDriver() return opengl.Get()
} }

View File

@ -25,7 +25,7 @@ import (
var theDriver Driver var theDriver Driver
func GetDriver() *Driver { func Get() *Driver {
return &theDriver return &theDriver
} }

View File

@ -206,8 +206,8 @@ func (u *userInterface) update(g GraphicsContext) error {
} }
hooks.ResumeAudio() hooks.ResumeAudio()
if opengl.GetDriver().IsContextLost() { if opengl.Get().IsContextLost() {
opengl.GetDriver().RestoreContext() opengl.Get().RestoreContext()
g.Invalidate() g.Invalidate()
// Need to return once to wait restored (#526) // Need to return once to wait restored (#526)

View File

@ -53,7 +53,7 @@ func Render(chError <-chan error) error {
// TODO: Check this is called on the rendering thread // TODO: Check this is called on the rendering thread
select { select {
case renderCh <- struct{}{}: case renderCh <- struct{}{}:
return opengl.GetDriver().DoWork(chError, renderChEnd) return opengl.Get().DoWork(chError, renderChEnd)
case <-time.After(500 * time.Millisecond): case <-time.After(500 * time.Millisecond):
// This function must not be blocked. We need to break for timeout. // This function must not be blocked. We need to break for timeout.
return nil return nil
@ -152,9 +152,9 @@ func Run(width, height int, scale float64, title string, g GraphicsContext, main
if mainloop { if mainloop {
ctx := <-glContextCh ctx := <-glContextCh
opengl.GetDriver().InitWithContext(ctx) opengl.Get().InitWithContext(ctx)
} else { } else {
opengl.GetDriver().Init() opengl.Get().Init()
} }
// Force to set the screen size // Force to set the screen size