Use AnyEvent instead of glutMainLoop