Example #1
0
func main() {
	{ // Profiling
		cpu, err := os.Create("cpu.prof")
		if err != nil {
			panic(err)
		}
		defer cpu.Close()
		pprof.StartCPUProfile(cpu)
		defer pprof.StopCPUProfile()
	}

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()
	params := engine.Params{
		Version: [2]int{4, 3},
		Size:    [2]int{512, 512},
	}
	engine := engine.New()
	if err := engine.Initialize("TICKLES", params, &MainState{}); err != nil {
		panic(err)
	}
	if err := engine.Run(); err != nil {
		panic(err)
	}
	if err := engine.Shutdown(); err != nil {
		panic(err)
	}
}
Example #2
0
func main() {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()
	params := engine.Params{
		Version: [2]int{4, 4},
		Size:    [2]int{512, 512},
	}
	engine := engine.New()
	if err := engine.Initialize("GPU TICKLES", params, &MainState{}); err != nil {
		panic(err)
	}
	if err := engine.Run(); err != nil {
		panic(err)
	}
	if err := engine.Shutdown(); err != nil {
		panic(err)
	}
}