mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/ui: refactoring
This commit is contained in:
parent
d4e1787154
commit
e05df6a778
@ -30,8 +30,6 @@ import (
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/hooks"
|
||||
)
|
||||
|
||||
const DefaultTPS = clock.DefaultTPS
|
||||
|
||||
type Game interface {
|
||||
NewOffscreenImage(width, height int) *Image
|
||||
Layout(outsideWidth, outsideHeight int) (int, int)
|
||||
@ -353,14 +351,6 @@ func SetFPSMode(fpsMode FPSModeType) {
|
||||
theUI.SetFPSMode(fpsMode)
|
||||
}
|
||||
|
||||
func TPS() int {
|
||||
return clock.TPS()
|
||||
}
|
||||
|
||||
func SetTPS(tps int) {
|
||||
clock.SetTPS(tps)
|
||||
}
|
||||
|
||||
func IsScreenClearedEveryFrame() bool {
|
||||
return theGlobalState.isScreenClearedEveryFrame()
|
||||
}
|
||||
|
6
run.go
6
run.go
@ -76,7 +76,7 @@ type Game interface {
|
||||
}
|
||||
|
||||
// DefaultTPS represents a default ticks per second, that represents how many times game updating happens in a second.
|
||||
const DefaultTPS = ui.DefaultTPS
|
||||
const DefaultTPS = clock.DefaultTPS
|
||||
|
||||
// CurrentFPS returns the current number of FPS (frames per second), that represents
|
||||
// how many swapping buffer happens per second.
|
||||
@ -417,7 +417,7 @@ func ScheduleFrame() {
|
||||
//
|
||||
// MaxTPS is concurrent-safe.
|
||||
func MaxTPS() int {
|
||||
return ui.TPS()
|
||||
return clock.TPS()
|
||||
}
|
||||
|
||||
// CurrentTPS returns the current TPS (ticks per second),
|
||||
@ -447,7 +447,7 @@ const UncappedTPS = SyncWithFPS
|
||||
//
|
||||
// SetMaxTPS is concurrent-safe.
|
||||
func SetMaxTPS(tps int) {
|
||||
ui.SetTPS(tps)
|
||||
clock.SetTPS(tps)
|
||||
}
|
||||
|
||||
// IsScreenTransparent reports whether the window is transparent.
|
||||
|
Loading…
Reference in New Issue
Block a user