mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-13 12:32:05 +01:00
parent
8fae2e1c18
commit
9fe4191a6a
8
run.go
8
run.go
@ -296,8 +296,14 @@ func runGame(game Game, scale float64) error {
|
|||||||
// Ebiten users should NOT call RunGameWithoutMainLoop.
|
// Ebiten users should NOT call RunGameWithoutMainLoop.
|
||||||
// Instead, functions in github.com/hajimehoshi/ebiten/mobile package calls this.
|
// Instead, functions in github.com/hajimehoshi/ebiten/mobile package calls this.
|
||||||
func RunGameWithoutMainLoop(game Game) {
|
func RunGameWithoutMainLoop(game Game) {
|
||||||
game = &imageDumperGame{game: game}
|
|
||||||
fixWindowPosition(WindowSize())
|
fixWindowPosition(WindowSize())
|
||||||
|
if _, ok := game.(interface{ Draw(*Image) }); ok {
|
||||||
|
game = &imageDumperGameWithDraw{
|
||||||
|
imageDumperGame: imageDumperGame{game: game},
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
game = &imageDumperGame{game: game}
|
||||||
|
}
|
||||||
theUIContext.set(game, 0)
|
theUIContext.set(game, 0)
|
||||||
uiDriver().RunWithoutMainLoop(theUIContext)
|
uiDriver().RunWithoutMainLoop(theUIContext)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user