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 {
return opengl.GetDriver()
return opengl.Get()
}

View File

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

View File

@ -206,8 +206,8 @@ func (u *userInterface) update(g GraphicsContext) error {
}
hooks.ResumeAudio()
if opengl.GetDriver().IsContextLost() {
opengl.GetDriver().RestoreContext()
if opengl.Get().IsContextLost() {
opengl.Get().RestoreContext()
g.Invalidate()
// 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
select {
case renderCh <- struct{}{}:
return opengl.GetDriver().DoWork(chError, renderChEnd)
return opengl.Get().DoWork(chError, renderChEnd)
case <-time.After(500 * time.Millisecond):
// This function must not be blocked. We need to break for timeout.
return nil
@ -152,9 +152,9 @@ func Run(width, height int, scale float64, title string, g GraphicsContext, main
if mainloop {
ctx := <-glContextCh
opengl.GetDriver().InitWithContext(ctx)
opengl.Get().InitWithContext(ctx)
} else {
opengl.GetDriver().Init()
opengl.Get().Init()
}
// Force to set the screen size