Exemple #1
0
func mainLoop(e *bronson.Bronson) {
	shouldQuit = false
	for !shouldQuit {
		handleInput(e)
		e.ProcessOneFrame()
	}
}
Exemple #2
0
func handleInput(b *bronson.Bronson) {
	for _, event := range b.ReceiveEvents() {
		switch /*t := */ event.(type) {
		case *sdl.QuitEvent:
			shouldQuit = true
			b.Cleanup()
			break
		case *sdl.MouseMotionEvent:
			break
			//fmt.Printf("[%d ms] MouseMotion\tid:%d\tx:%d\ty:%d\txrel:%d\tyrel:%d\n",
			//           t.Timestamp, t.Which, t.X, t.Y, t.XRel, t.YRel)
		}
	}
}