From e24f6b7848c9292cdf89b5fc098f044175114a96 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 13 Nov 2018 00:01:26 +0900 Subject: [PATCH] graphicsdriver/opengl: Rename GetDriver -> Get --- internal/graphicscommand/driver.go | 2 +- internal/graphicsdriver/opengl/driver.go | 2 +- internal/ui/ui_js.go | 4 ++-- internal/ui/ui_mobile.go | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/graphicscommand/driver.go b/internal/graphicscommand/driver.go index a01db9e04..57fa8e1f0 100644 --- a/internal/graphicscommand/driver.go +++ b/internal/graphicscommand/driver.go @@ -20,5 +20,5 @@ import ( ) func driver() graphicsdriver.GraphicsDriver { - return opengl.GetDriver() + return opengl.Get() } diff --git a/internal/graphicsdriver/opengl/driver.go b/internal/graphicsdriver/opengl/driver.go index dbb6e3a33..97eb97e75 100644 --- a/internal/graphicsdriver/opengl/driver.go +++ b/internal/graphicsdriver/opengl/driver.go @@ -25,7 +25,7 @@ import ( var theDriver Driver -func GetDriver() *Driver { +func Get() *Driver { return &theDriver } diff --git a/internal/ui/ui_js.go b/internal/ui/ui_js.go index baa0c3b42..5a52afc37 100644 --- a/internal/ui/ui_js.go +++ b/internal/ui/ui_js.go @@ -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) diff --git a/internal/ui/ui_mobile.go b/internal/ui/ui_mobile.go index aa1938cd5..ee5a69442 100644 --- a/internal/ui/ui_mobile.go +++ b/internal/ui/ui_mobile.go @@ -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