Bug fix: Compile error on GOOS=linux CGO_ENABLED=0

This commit is contained in:
Hajime Hoshi 2019-08-01 08:16:59 +09:00
parent 2003b7d292
commit df8fdc855a
4 changed files with 7 additions and 7 deletions

View File

@ -17,8 +17,13 @@ package driver
import (
"errors"
"image"
"time"
)
// IsPlayground indicates whether the current environment is the Go Playground (play.golang.org) or not.
// The fixed time is explicitly defined. See "About the Playground" at play.golang.org.
var IsPlayground = time.Now().UnixNano() == 1257894000000000000
type UIContext interface {
SetSize(width, height int, scale float64)
Update(afterFrameUpdate func()) error

View File

@ -27,7 +27,7 @@ import (
)
func Get() driver.Graphics {
if !isPlayground {
if !driver.IsPlayground {
panic("ebiten: a graphics driver is not implemented on this environment")
}
// TODO: Implement this

View File

@ -27,7 +27,7 @@ import (
)
func Get() driver.UI {
if !isPlayground {
if !driver.IsPlayground {
panic("ebiten: a UI driver is not implemented on this environment")
}
// TODO: Implement this

5
run.go
View File

@ -17,7 +17,6 @@ package ebiten
import (
"image"
"sync/atomic"
"time"
"github.com/hajimehoshi/ebiten/internal/clock"
"github.com/hajimehoshi/ebiten/internal/driver"
@ -28,10 +27,6 @@ import (
var _ = __EBITEN_REQUIRES_GO_VERSION_1_12_OR_LATER__
// isPlayground indicates whether the current environment is the Go Playground (play.golang.org) or not.
// The fixed time is explicitly defined. See "About the Playground" at play.golang.org.
var isPlayground = time.Now().UnixNano() == 1257894000000000000
// TPS represents a default ticks per second, that represents how many times game updating happens in a second.
const DefaultTPS = 60