mobile/ebitenmobileview: Remove 'title' argument from Run

This commit is contained in:
Hajime Hoshi 2019-08-11 21:04:54 +09:00
parent c93075d1dc
commit 2925fc718b
4 changed files with 11 additions and 8 deletions

View File

@ -14,8 +14,8 @@
// Package ebitenmobileview offers functions for OpenGL/Metal view of mobiles.
//
// The functions are not intended for public usages, and there is no guarantee of
// backward compatibility.
// The functions are not intended for public usages.
// There is no guarantee of backward compatibility.
package ebitenmobileview
import (
@ -32,14 +32,14 @@ var (
mobileMutex sync.Mutex
)
func Run(width, height int, scale float64, title string) {
func Run(width, height int, scale float64) {
mobileMutex.Lock()
defer mobileMutex.Unlock()
if updateFunc == nil {
panic("ebitenmobileview: SetUpdateFunc must be called before Run")
}
start(updateFunc, width, height, scale, title)
start(updateFunc, width, height, scale)
}
func Update() error {

View File

@ -29,7 +29,7 @@ func update() error {
return nil
}
func start(f func(*ebiten.Image) error, width, height int, scale float64, title string) {
func start(f func(*ebiten.Image) error, width, height int, scale float64) {
}
func updateTouchesOnAndroid(action int, id int, x, y int) {

View File

@ -46,7 +46,8 @@ func update() error {
return nil
}
func start(f func(*ebiten.Image) error, width, height int, scale float64, title string) {
func start(f func(*ebiten.Image) error, width, height int, scale float64) {
running = true
chError = ebiten.RunWithoutMainLoop(f, width, height, scale, title)
// The last argument 'title' is not used on mobile platforms, so just pass an empty string.
chError = ebiten.RunWithoutMainLoop(f, width, height, scale, "")
}

View File

@ -33,10 +33,12 @@ import (
//
// Start is concurrent-safe.
//
// The argument title is ignored. This is for backward compatibility.
//
// Start always returns nil as of 1.5.0-alpha.
func Start(f func(*ebiten.Image) error, width, height int, scale float64, title string) error {
ebitenmobileview.SetUpdateFunc(f)
ebitenmobileview.Run(width, height, scale, title)
ebitenmobileview.Run(width, height, scale)
return nil
}