internal/ui: return errors when getting a graphics driver fails

This commit is contained in:
Hajime Hoshi 2023-10-15 18:26:13 +09:00
parent 8274b32301
commit d4e31aedd6
6 changed files with 9 additions and 9 deletions

View File

@ -108,11 +108,11 @@ func (g *graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error)
}
func (*graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error) {
return nil, nil
return nil, fmt.Errorf("ui: DirectX is not supported in this environment")
}
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
return nil, nil
return nil, fmt.Errorf("ui: Metal is not supported in this environment")
}
func deviceScaleFactorImpl() float64 {

View File

@ -185,7 +185,7 @@ func (*graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error) {
}
func (*graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error) {
return nil, nil
return nil, fmt.Errorf("ui: DirectX is not supported in this environment")
}
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {

View File

@ -55,7 +55,7 @@ func (g *graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error)
}
func (*graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error) {
return nil, nil
return nil, fmt.Errorf("ui: DirectX is not supported in this environment")
}
func (g *graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {

View File

@ -47,11 +47,11 @@ func (*graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error) {
}
func (*graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error) {
return nil, nil
return nil, fmt.Errorf("ui: DirectX is not supported in this environment")
}
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
return nil, nil
return nil, fmt.Errorf("ui: Metal is not supported in this environment")
}
// glfwMonitorSizeInGLFWPixels must be called from the main thread.

View File

@ -46,11 +46,11 @@ func (*graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error) {
}
func (*graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error) {
return nil, nil
return nil, fmt.Errorf("ui: DirectX is not supported in this environment")
}
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
return nil, nil
return nil, fmt.Errorf("ui: Metal is not supported in this environment")
}
const deviceScaleFactor = 1

View File

@ -86,7 +86,7 @@ func (g *graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error
}
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
return nil, nil
return nil, fmt.Errorf("ui: Metal is not supported in this environment")
}
// glfwMonitorSizeInGLFWPixels must be called from the main thread.