mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +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.
|
// 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).
|
// 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?
|
// 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)
|
newMetal() (graphicsdriver.Graphics, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func chooseGraphicsDriver(creator graphicsDriverCreator) (graphicsdriver.Graphics, error) {
|
func newGraphicsDriver(creator graphicsDriverCreator) (graphicsdriver.Graphics, error) {
|
||||||
const envName = "EBITEN_GRAPHICS_LIBRARY"
|
const envName = "EBITEN_GRAPHICS_LIBRARY"
|
||||||
|
|
||||||
switch env := os.Getenv(envName); env {
|
switch env := os.Getenv(envName); env {
|
||||||
|
@ -58,7 +58,7 @@ type userInterfaceImpl struct {
|
|||||||
|
|
||||||
func (u *userInterfaceImpl) Run(game Game) error {
|
func (u *userInterfaceImpl) Run(game Game) error {
|
||||||
u.context = newContext(game)
|
u.context = newContext(game)
|
||||||
g, err := chooseGraphicsDriver(&graphicsDriverCreatorImpl{})
|
g, err := newGraphicsDriver(&graphicsDriverCreatorImpl{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -834,7 +834,7 @@ func (u *userInterfaceImpl) init() error {
|
|||||||
}
|
}
|
||||||
glfw.WindowHint(glfw.TransparentFramebuffer, glfwTransparent)
|
glfw.WindowHint(glfw.TransparentFramebuffer, glfwTransparent)
|
||||||
|
|
||||||
g, err := chooseGraphicsDriver(&graphicsDriverCreatorImpl{
|
g, err := newGraphicsDriver(&graphicsDriverCreatorImpl{
|
||||||
transparent: transparent,
|
transparent: transparent,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -609,7 +609,7 @@ func (u *userInterfaceImpl) Run(game Game) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
u.running = true
|
u.running = true
|
||||||
g, err := chooseGraphicsDriver(&graphicsDriverCreatorImpl{})
|
g, err := newGraphicsDriver(&graphicsDriverCreatorImpl{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -270,7 +270,7 @@ func (u *userInterfaceImpl) run(game Game, mainloop bool) (err error) {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
u.context = newContext(game)
|
u.context = newContext(game)
|
||||||
g, err := chooseGraphicsDriver(&graphicsDriverCreatorImpl{
|
g, err := newGraphicsDriver(&graphicsDriverCreatorImpl{
|
||||||
gomobileBuild: mainloop,
|
gomobileBuild: mainloop,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user