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