Пример #1
0
func visible(vis int) {
	if vis == glut.VISIBLE {
		if !paused {
			glut.IdleFunc(frame)
		}
	} else {
		glut.IdleFunc(pausedFrame)
	}
}
Пример #2
0
func key(key byte, px, py int) {
	switch key {
	case 27:
		os.Exit(0)
	case 'F', 'f':
		if !fullscreen {
			glut.FullScreen()
			fullscreen = true
		} else {
			glut.ReshapeWindow(800, 800)
			fullscreen = false
		}
	case 'P', 'p':
		paused = !paused
		if paused {
			glut.IdleFunc(pausedFrame)
			model.Resuming = false
		} else {
			glut.IdleFunc(frame)
			model.Resuming = true
			print("blah\n")
		}
	}
}