mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
docs: Add comment to IsRunningSlowly
This commit is contained in:
parent
92f4388dfd
commit
35bbee9307
11
run.go
11
run.go
@ -54,6 +54,17 @@ func setRunningSlowly(slow bool) {
|
||||
// It is recommended to skip heavy processing, especially drawing screen,
|
||||
// when IsRunningSlowly is true.
|
||||
//
|
||||
// The typical code with IsRunningSlowly is this:
|
||||
//
|
||||
// func update(screen *ebiten.Image) error {
|
||||
// // update the state
|
||||
// if ebiten.IsRunningSlowly() {
|
||||
// return nil
|
||||
// }
|
||||
// // draw something to the screen
|
||||
// return nil
|
||||
// }
|
||||
//
|
||||
// This function is concurrent-safe.
|
||||
func IsRunningSlowly() bool {
|
||||
return atomic.LoadInt32(&isRunningSlowly) != 0
|
||||
|
Loading…
Reference in New Issue
Block a user