Exemplo n.º 1
0
func main() {
	if cpuprofile != "" {
		f, err := os.Create(cpuprofile)
		if err != nil {
			log.Fatal(err)
		}
		pprof.StartCPUProfile(f)
		defer pprof.StopCPUProfile()
		c := make(chan os.Signal, 1)
		signal.Notify(c, os.Interrupt)
		go func() {
			for range c {
				pprof.StopCPUProfile()
				os.Exit(0)
			}
		}()
	}

	engi.RegisterScene(&scenes.Menu{})
	engi.RegisterScene(&scenes.Calibrate{})

	// TODO: don't hardcode this
	engi.Open(gameTitle, 1600, 800, false, &BCIGame{})
}
Exemplo n.º 2
0
func main() {
	iconScene = &IconScene{}
	rockScene = &RockScene{}

	// Register other Scenes for later use, this can be done from anywhere, as long as it
	// happens before calling engi.SetSceneByName
	engi.RegisterScene(rockScene)

	opts := engi.RunOptions{
		Title:  "Scenes Demo",
		Width:  1024,
		Height: 640,
	}

	engi.Open(opts, iconScene)
}