internal/graphicsdriver/metal, internal/graphicsdriver/opengl: change the return type to interface

Converting a nil with a pointer type to an interface type is no longer
a nil-nil interface, and then comparing with nil causes an unexpected
results.
This commit is contained in:
Hajime Hoshi 2022-03-24 03:24:55 +09:00
parent 60e9ff35b2
commit 7bb7e45522
2 changed files with 2 additions and 2 deletions

View File

@ -367,7 +367,7 @@ func init() {
var theGraphics Graphics
func Get() *Graphics {
func Get() graphicsdriver.Graphics {
if !isMetalAvailable {
return nil
}

View File

@ -24,7 +24,7 @@ import (
var theGraphics Graphics
func Get() *Graphics {
func Get() graphicsdriver.Graphics {
return &theGraphics
}