internal/ui: rename chooseGraphicsDriver -> newGraphicsDriver

This commit is contained in:
Hajime Hoshi 2022-06-17 02:32:03 +09:00
parent 7484df0c5e
commit 138463e219
6 changed files with 6 additions and 6 deletions

View File

@ -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?

View File

@ -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 {

View File

@ -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
}

View File

@ -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 {

View File

@ -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
}

View File

@ -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 {