mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
internal/ui: use errors.New instead of fmt.Errorf
This commit is contained in:
parent
742f3a6dac
commit
47e70f2544
@ -17,6 +17,7 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"unsafe"
|
||||
@ -185,7 +186,7 @@ func (*graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error) {
|
||||
}
|
||||
|
||||
func (*graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error) {
|
||||
return nil, fmt.Errorf("ui: DirectX is not supported in this environment")
|
||||
return nil, errors.New("ui: DirectX is not supported in this environment")
|
||||
}
|
||||
|
||||
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"errors"
|
||||
"image"
|
||||
"math"
|
||||
"sync"
|
||||
@ -43,11 +43,11 @@ func (g *graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error)
|
||||
}
|
||||
|
||||
func (*graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error) {
|
||||
return nil, fmt.Errorf("ui: DirectX is not supported in this environment")
|
||||
return nil, errors.New("ui: DirectX is not supported in this environment")
|
||||
}
|
||||
|
||||
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
|
||||
return nil, fmt.Errorf("ui: Metal is not supported in this environment")
|
||||
return nil, errors.New("ui: Metal is not supported in this environment")
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -17,6 +17,7 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"runtime"
|
||||
|
||||
@ -47,11 +48,11 @@ func (*graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error) {
|
||||
}
|
||||
|
||||
func (*graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error) {
|
||||
return nil, fmt.Errorf("ui: DirectX is not supported in this environment")
|
||||
return nil, errors.New("ui: DirectX is not supported in this environment")
|
||||
}
|
||||
|
||||
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
|
||||
return nil, fmt.Errorf("ui: Metal is not supported in this environment")
|
||||
return nil, errors.New("ui: Metal is not supported in this environment")
|
||||
}
|
||||
|
||||
// glfwMonitorSizeInGLFWPixels must be called from the main thread.
|
||||
|
@ -22,7 +22,7 @@ import "C"
|
||||
|
||||
import (
|
||||
stdcontext "context"
|
||||
"fmt"
|
||||
"errors"
|
||||
"image"
|
||||
"runtime"
|
||||
"sync"
|
||||
@ -47,11 +47,11 @@ func (*graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error) {
|
||||
}
|
||||
|
||||
func (*graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error) {
|
||||
return nil, fmt.Errorf("ui: DirectX is not supported in this environment")
|
||||
return nil, errors.New("ui: DirectX is not supported in this environment")
|
||||
}
|
||||
|
||||
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
|
||||
return nil, fmt.Errorf("ui: Metal is not supported in this environment")
|
||||
return nil, errors.New("ui: Metal is not supported in this environment")
|
||||
}
|
||||
|
||||
const deviceScaleFactor = 1
|
||||
|
@ -80,13 +80,13 @@ func (*graphicsDriverCreatorImpl) newOpenGL() (graphicsdriver.Graphics, error) {
|
||||
|
||||
func (g *graphicsDriverCreatorImpl) newDirectX() (graphicsdriver.Graphics, error) {
|
||||
if g.transparent {
|
||||
return nil, fmt.Errorf("ui: DirectX is not available with a transparent window")
|
||||
return nil, errors.New("ui: DirectX is not available with a transparent window")
|
||||
}
|
||||
return directx.NewGraphics()
|
||||
}
|
||||
|
||||
func (*graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
|
||||
return nil, fmt.Errorf("ui: Metal is not supported in this environment")
|
||||
return nil, errors.New("ui: Metal is not supported in this environment")
|
||||
}
|
||||
|
||||
// glfwMonitorSizeInGLFWPixels must be called from the main thread.
|
||||
|
Loading…
Reference in New Issue
Block a user