mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/ui: rename chooseGraphicsDriver -> newGraphicsDriver
This commit is contained in:
parent
7484df0c5e
commit
138463e219
@ -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?
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user