mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
Bug fix: Compile error on GOOS=linux CGO_ENABLED=0
This commit is contained in:
parent
2003b7d292
commit
df8fdc855a
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
5
run.go
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user