ebiten: Deprecate Run

Fixes #1184
This commit is contained in:
Hajime Hoshi 2020-06-22 03:45:16 +09:00
parent 1f9cc53ce4
commit afef032acc
2 changed files with 3 additions and 26 deletions

26
doc.go
View File

@ -49,32 +49,6 @@
// }
// }
//
// For backward compatibility, you can use a shorthand style Run.
//
// // update proceeds the game state.
// // update is called every frame (1/60 [s]).
// func update(screen *ebiten.Image) error {
//
// // Write your game's logical update.
//
// if ebiten.IsDrawingSkipped() {
// // When the game is running slowly, the rendering result
// // will not be adopted.
// return nil
// }
//
// // Write your game's rendering.
//
// return nil
// }
//
// func main() {
// // Call ebiten.Run to start your game loop.
// if err := ebiten.Run(update, 320, 240, 2, "Your game's title"); err != nil {
// log.Fatal(err)
// }
// }
//
// In the API document, 'the main thread' means the goroutine in init(), main() and their callees without 'go'
// statement. It is assured that 'the main thread' runs on the OS main thread. There are some Ebiten functions that
// must be called on the main thread under some conditions (typically, before ebiten.RunGame is called).

3
run.go
View File

@ -139,6 +139,9 @@ func IsRunningSlowly() bool {
}
// Run starts the main loop and runs the game.
//
// Deprecated: (as of 1.12.0) Use RunGame instead.
//
// f is a function which is called at every frame.
// The argument (*Image) is the render target that represents the screen.
// The screen size is based on the given values (width and height).