mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-24 18:02:02 +01:00
parent
ada9a4ab49
commit
833e467fde
@ -49,6 +49,7 @@ script:
|
||||
- gjbt github.com/hajimehoshi/ebiten # TODO: Test the subdirectories
|
||||
- GOOS=windows GOARCH=amd64 go build -tags example -v github.com/hajimehoshi/ebiten/examples/...
|
||||
- GOOS=windows GOARCH=386 go build -tags example -v github.com/hajimehoshi/ebiten/examples/...
|
||||
- CGO_ENABLED=0 go vet github.com/hajimehoshi/ebiten # This is necessary for the Go playground
|
||||
|
||||
# - test -z $(gofmt -s -l $GOPATH/src/github.com/hajimehoshi/ebiten)
|
||||
|
||||
|
@ -12,7 +12,9 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +build !darwin ios js
|
||||
// +build android freebsd ios js linux,cgo windows
|
||||
|
||||
// As the Go playground tries to compile this with CGO_ENABLED=0 and GOOS=linux, check Cgo on build tags.
|
||||
|
||||
package ebiten
|
||||
|
35
graphics_playground.go
Normal file
35
graphics_playground.go
Normal file
@ -0,0 +1,35 @@
|
||||
// Copyright 2019 The Ebiten Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +build !android
|
||||
// +build !darwin
|
||||
// +build !freebsd
|
||||
// +build !ios
|
||||
// +build !js
|
||||
// +build !linux,cgo !cgo
|
||||
// +build !windows
|
||||
|
||||
package ebiten
|
||||
|
||||
import (
|
||||
"github.com/hajimehoshi/ebiten/internal/driver"
|
||||
)
|
||||
|
||||
func graphicsDriver() driver.Graphics {
|
||||
if !isPlayground {
|
||||
panic("ebiten: a graphics driver is not implemented on this environment")
|
||||
}
|
||||
// TODO: Implement this
|
||||
return nil
|
||||
}
|
5
run.go
5
run.go
@ -17,6 +17,7 @@ package ebiten
|
||||
import (
|
||||
"image"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/internal/clock"
|
||||
"github.com/hajimehoshi/ebiten/internal/driver"
|
||||
@ -25,6 +26,10 @@ 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
|
||||
|
||||
|
@ -12,10 +12,10 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +build darwin freebsd linux windows
|
||||
// +build !js
|
||||
// +build darwin freebsd linux,cgo windows
|
||||
// +build !android
|
||||
// +build !ios
|
||||
// +build !js
|
||||
|
||||
package ebiten
|
||||
|
||||
|
35
ui_playground.go
Normal file
35
ui_playground.go
Normal file
@ -0,0 +1,35 @@
|
||||
// Copyright 2019 The Ebiten Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +build !android
|
||||
// +build !darwin
|
||||
// +build !freebsd
|
||||
// +build !ios
|
||||
// +build !js
|
||||
// +build !linux,cgo !cgo
|
||||
// +build !windows
|
||||
|
||||
package ebiten
|
||||
|
||||
import (
|
||||
"github.com/hajimehoshi/ebiten/internal/driver"
|
||||
)
|
||||
|
||||
func uiDriver() driver.UI {
|
||||
if !isPlayground {
|
||||
panic("ebiten: a UI driver is not implemented on this environment")
|
||||
}
|
||||
// TODO: Implement this
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user