mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
parent
08783542eb
commit
9bfbbb6e9e
@ -24,6 +24,7 @@ import (
|
||||
type graphicsDriverGetter interface {
|
||||
getAuto() graphicsdriver.Graphics
|
||||
getOpenGL() graphicsdriver.Graphics
|
||||
getDirectX() graphicsdriver.Graphics
|
||||
getMetal() graphicsdriver.Graphics
|
||||
}
|
||||
|
||||
@ -41,6 +42,11 @@ func chooseGraphicsDriver(getter graphicsDriverGetter) (graphicsdriver.Graphics,
|
||||
return g, nil
|
||||
}
|
||||
return nil, fmt.Errorf("ui: %s=%s is specified but OpenGL is not available", envName, env)
|
||||
case "directx":
|
||||
if g := getter.getDirectX(); g != nil {
|
||||
return g, nil
|
||||
}
|
||||
return nil, fmt.Errorf("ui: %s=%s is specified but DirectX is not available.", envName, env)
|
||||
case "metal":
|
||||
if g := getter.getMetal(); g != nil {
|
||||
return g, nil
|
||||
|
@ -34,6 +34,10 @@ func (*graphicsDriverGetterImpl) getOpenGL() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getDirectX() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getMetal() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
@ -38,6 +38,10 @@ func (*graphicsDriverGetterImpl) getOpenGL() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getDirectX() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getMetal() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
@ -248,6 +248,10 @@ func (*graphicsDriverGetterImpl) getOpenGL() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getDirectX() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getMetal() graphicsdriver.Graphics {
|
||||
if m := metal.Get(); m != nil {
|
||||
return m
|
||||
|
@ -44,6 +44,10 @@ func (*graphicsDriverGetterImpl) getOpenGL() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getDirectX() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getMetal() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
@ -42,6 +42,10 @@ func (*graphicsDriverGetterImpl) getOpenGL() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getDirectX() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getMetal() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
@ -41,6 +41,10 @@ func (*graphicsDriverGetterImpl) getOpenGL() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getDirectX() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (g *graphicsDriverGetterImpl) getMetal() graphicsdriver.Graphics {
|
||||
// When gomobile-build is used, GL functions must be called via
|
||||
// gl.Context so that they are called on the appropriate thread.
|
||||
|
@ -38,6 +38,10 @@ func (*graphicsDriverGetterImpl) getOpenGL() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getDirectX() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*graphicsDriverGetterImpl) getMetal() graphicsdriver.Graphics {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user