From 138463e21904b254d8480abb3cf7af8bfb8ed5df Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 17 Jun 2022 02:32:03 +0900 Subject: [PATCH] internal/ui: rename chooseGraphicsDriver -> newGraphicsDriver --- internal/graphicsdriver/metal/graphics_darwin.go | 2 +- internal/ui/graphics.go | 2 +- internal/ui/ui_cbackend.go | 2 +- internal/ui/ui_glfw.go | 2 +- internal/ui/ui_js.go | 2 +- internal/ui/ui_mobile.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/graphicsdriver/metal/graphics_darwin.go b/internal/graphicsdriver/metal/graphics_darwin.go index 0c84acb0a..6a0067755 100644 --- a/internal/graphicsdriver/metal/graphics_darwin.go +++ b/internal/graphicsdriver/metal/graphics_darwin.go @@ -354,7 +354,7 @@ func NewGraphics() (graphicsdriver.Graphics, error) { } // Initialize isMetalAvailable on the main thread. - // TODO: Now ui.chooseGraphicsDriver is called on the main thread. Add an assertion. + // TODO: Now ui.newGraphicsDriver is called on the main thread. Add an assertion. // On old mac devices like iMac 2011, Metal is not supported (#779). // TODO: Is there a better way to check whether Metal is available or not? diff --git a/internal/ui/graphics.go b/internal/ui/graphics.go index 3df51e6a6..62e144fd7 100644 --- a/internal/ui/graphics.go +++ b/internal/ui/graphics.go @@ -28,7 +28,7 @@ type graphicsDriverCreator interface { newMetal() (graphicsdriver.Graphics, error) } -func chooseGraphicsDriver(creator graphicsDriverCreator) (graphicsdriver.Graphics, error) { +func newGraphicsDriver(creator graphicsDriverCreator) (graphicsdriver.Graphics, error) { const envName = "EBITEN_GRAPHICS_LIBRARY" switch env := os.Getenv(envName); env { diff --git a/internal/ui/ui_cbackend.go b/internal/ui/ui_cbackend.go index 15f569d4d..b9d99a5c9 100644 --- a/internal/ui/ui_cbackend.go +++ b/internal/ui/ui_cbackend.go @@ -58,7 +58,7 @@ type userInterfaceImpl struct { func (u *userInterfaceImpl) Run(game Game) error { u.context = newContext(game) - g, err := chooseGraphicsDriver(&graphicsDriverCreatorImpl{}) + g, err := newGraphicsDriver(&graphicsDriverCreatorImpl{}) if err != nil { return err } diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index 06810d2c4..c488c50b0 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -834,7 +834,7 @@ func (u *userInterfaceImpl) init() error { } glfw.WindowHint(glfw.TransparentFramebuffer, glfwTransparent) - g, err := chooseGraphicsDriver(&graphicsDriverCreatorImpl{ + g, err := newGraphicsDriver(&graphicsDriverCreatorImpl{ transparent: transparent, }) if err != nil { diff --git a/internal/ui/ui_js.go b/internal/ui/ui_js.go index c2006c9ec..28aae7f52 100644 --- a/internal/ui/ui_js.go +++ b/internal/ui/ui_js.go @@ -609,7 +609,7 @@ func (u *userInterfaceImpl) Run(game Game) error { } } u.running = true - g, err := chooseGraphicsDriver(&graphicsDriverCreatorImpl{}) + g, err := newGraphicsDriver(&graphicsDriverCreatorImpl{}) if err != nil { return err } diff --git a/internal/ui/ui_mobile.go b/internal/ui/ui_mobile.go index 31e4a984c..ca1a6b87b 100644 --- a/internal/ui/ui_mobile.go +++ b/internal/ui/ui_mobile.go @@ -270,7 +270,7 @@ func (u *userInterfaceImpl) run(game Game, mainloop bool) (err error) { }() u.context = newContext(game) - g, err := chooseGraphicsDriver(&graphicsDriverCreatorImpl{ + g, err := newGraphicsDriver(&graphicsDriverCreatorImpl{ gomobileBuild: mainloop, }) if err != nil {