mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
internal/ui: use errors.New instead of fmt.Errorf
This commit is contained in:
parent
e1f18b53f5
commit
ed49d8cc9a
@ -85,6 +85,7 @@ static float deviceScale(uintptr_t java_vm, uintptr_t jni_env, uintptr_t ctx) {
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"golang.org/x/mobile/app"
|
||||
@ -108,11 +109,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.Errorf("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.Errorf("ui: Metal is not supported in this environment")
|
||||
}
|
||||
|
||||
func deviceScaleFactorImpl() float64 {
|
||||
|
@ -25,6 +25,7 @@ package ui
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"golang.org/x/mobile/gl"
|
||||
@ -55,12 +56,12 @@ 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.Errorf("ui: DirectX is not supported in this environment")
|
||||
}
|
||||
|
||||
func (g *graphicsDriverCreatorImpl) newMetal() (graphicsdriver.Graphics, error) {
|
||||
if g.gomobileContext != nil {
|
||||
return nil, fmt.Errorf("ui: Metal is not available with gomobile-build")
|
||||
return nil, errors.Errorf("ui: Metal is not available with gomobile-build")
|
||||
}
|
||||
return metal.NewGraphics()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user