A generic event loop for games and interactive applications