mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-04 23:14:28 +01:00
internal/ui: reland: return errors when getting a graphics driver fails
This commit is contained in:
parent
bd10f19567
commit
18714e22a1
@ -108,11 +108,11 @@ func (g *graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (*graphicsDriverCreatorImpl) newDirectX() (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) {
|
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
|
||||||
return nil, nil
|
return nil, fmt.Errorf("ui: Metal is not supported in this environment")
|
||||||
}
|
}
|
||||||
|
|
||||||
func deviceScaleFactorImpl() float64 {
|
func deviceScaleFactorImpl() float64 {
|
||||||
|
@ -185,7 +185,7 @@ func (*graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (*graphicsDriverCreatorImpl) newDirectX() (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) {
|
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
|
||||||
|
@ -55,7 +55,7 @@ func (g *graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (*graphicsDriverCreatorImpl) newDirectX() (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) {
|
func (g *graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
package ui
|
package ui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"image"
|
"image"
|
||||||
"math"
|
"math"
|
||||||
"sync"
|
"sync"
|
||||||
@ -42,11 +43,11 @@ func (g *graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (*graphicsDriverCreatorImpl) newDirectX() (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) {
|
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
|
||||||
return nil, nil
|
return nil, fmt.Errorf("ui: Metal is not supported in this environment")
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -47,11 +47,11 @@ func (*graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (*graphicsDriverCreatorImpl) newDirectX() (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) {
|
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.
|
// glfwMonitorSizeInGLFWPixels must be called from the main thread.
|
||||||
|
@ -22,6 +22,7 @@ import "C"
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
stdcontext "context"
|
stdcontext "context"
|
||||||
|
"fmt"
|
||||||
"image"
|
"image"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
@ -46,11 +47,11 @@ func (*graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (*graphicsDriverCreatorImpl) newDirectX() (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) {
|
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
|
||||||
return nil, nil
|
return nil, fmt.Errorf("ui: Metal is not supported in this environment")
|
||||||
}
|
}
|
||||||
|
|
||||||
const deviceScaleFactor = 1
|
const deviceScaleFactor = 1
|
||||||
|
@ -86,7 +86,7 @@ func (g *graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (*graphicsDriverCreatorImpl) newMetal() (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.
|
// glfwMonitorSizeInGLFWPixels must be called from the main thread.
|
||||||
|
Loading…
Reference in New Issue
Block a user