Still, I'm a bit lost. What if some part of my game needs to be updated as often as possible? For instance, the audio engine, or even just the graphics. Anytime I'm doing some game processing, I am not polling events, so will the window become non-responsive again?
Normally things don't need to get "updated as often as possible".
For example, if you've locked your framerate to 60 per second, then you can process your calculations with a factor that depends on the frame time. Let's say you want to get the number 60 just by adding 1:
1) 1 + 1 + 1 + ... + 1
2) 60 * 1
Which one would you prefer?
The drawback here is that this can get a little unprecise. With the 2nd method mentioned above, you never ever can get numbers below 60, just above (if the frame time needs longer than 1 / 60, ergo the frame rate drops below 60).
You have to ask yourself if you need this. If so, there're several solutions:
- Increase FPS (but you still should draw with the screen's vsync).
- Use a separate thread to do fine calculations or even all.
Time to choose, Mr. Freeman.