2013-07-05 15:25:45 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hajimehoshi/go.ebiten"
|
|
|
|
"github.com/hajimehoshi/go.ebiten/example/game/blank"
|
|
|
|
"github.com/hajimehoshi/go.ebiten/example/game/input"
|
|
|
|
"github.com/hajimehoshi/go.ebiten/example/game/monochrome"
|
|
|
|
"github.com/hajimehoshi/go.ebiten/example/game/rects"
|
|
|
|
"github.com/hajimehoshi/go.ebiten/example/game/rotating"
|
|
|
|
"github.com/hajimehoshi/go.ebiten/example/game/sprites"
|
2013-10-13 10:43:56 +02:00
|
|
|
_ "github.com/hajimehoshi/go.ebiten/ui/cocoa"
|
2013-07-05 15:25:45 +02:00
|
|
|
"github.com/hajimehoshi/go.ebiten/ui/glut"
|
|
|
|
"os"
|
|
|
|
"runtime"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
|
|
|
|
|
|
|
gameName := ""
|
|
|
|
if 2 <= len(os.Args) {
|
|
|
|
gameName = os.Args[1]
|
|
|
|
}
|
|
|
|
|
|
|
|
var game ebiten.Game
|
|
|
|
switch gameName {
|
|
|
|
case "blank":
|
|
|
|
game = blank.New()
|
|
|
|
case "input":
|
|
|
|
game = input.New()
|
|
|
|
case "monochrome":
|
|
|
|
game = monochrome.New()
|
|
|
|
case "rects":
|
|
|
|
game = rects.New()
|
|
|
|
case "rotating":
|
|
|
|
game = rotating.New()
|
|
|
|
case "sprites":
|
|
|
|
game = sprites.New()
|
|
|
|
default:
|
|
|
|
game = rotating.New()
|
|
|
|
}
|
|
|
|
|
|
|
|
const screenScale = 2
|
2013-10-09 16:34:11 +02:00
|
|
|
glut.Run(game, 256, 240, screenScale, "Ebiten Demo")
|
2013-07-05 15:25:45 +02:00
|
|
|
}
|