PistonDevelopers/piston — pull request #195 by gmorenz (2014-05-27 00:16:33+00:00)
Title: Make gameloop simpler, and fix #194

I pushed all the logic away from the rendering code into the update while condition, and a wait condition afterwards. The main motivation for this was making it easier to see how the code behaves, and modify it without breaking things.

This utilizes sleep for waiting instead of burning cpu cycles, at the cost of accuracy. Accuracy could be re-introduced with a while loop below it if there is a good reason to, I am just not aware of a good reason.

This fixes #194 by only updating to the update before catching up/passing next_render.