mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
Refactoring: Avoid using const FPS
This commit is contained in:
parent
93f8c76310
commit
1626e40822
@ -82,7 +82,7 @@ func (c *graphicsContext) initializeIfNeeded() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *graphicsContext) Update(afterFrameUpdate func()) error {
|
func (c *graphicsContext) Update(afterFrameUpdate func()) error {
|
||||||
updateCount := clock.Update(FPS)
|
updateCount := clock.Update(defaultTPS)
|
||||||
|
|
||||||
if err := c.initializeIfNeeded(); err != nil {
|
if err := c.initializeIfNeeded(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
4
run.go
4
run.go
@ -29,10 +29,12 @@ import (
|
|||||||
"github.com/hajimehoshi/ebiten/internal/ui"
|
"github.com/hajimehoshi/ebiten/internal/ui"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const defaultTPS = 60
|
||||||
|
|
||||||
// FPS represents how many times game updating happens in a second (60).
|
// FPS represents how many times game updating happens in a second (60).
|
||||||
//
|
//
|
||||||
// BUG: This actually represents TPS, not FPS.
|
// BUG: This actually represents TPS, not FPS.
|
||||||
const FPS = 60
|
const FPS = defaultTPS
|
||||||
|
|
||||||
// CurrentFPS returns the current number of frames per second of rendering.
|
// CurrentFPS returns the current number of frames per second of rendering.
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user