Hello, so this is about handling frames per second.
I know *logically* how to handle them, but the problem
is being accurate with thw win32 function named "Sleep()".
You know, when you want to handle fps you just check for times
differences between frames and just need to Sleep() for the amount of time remaining before you reach your actual framerate...
So if I want 60fps, I'll have to do 1000ms/60fps = ~17ms
So I have to use Sleep(17 - time elapsed)...
Here the problem is the way Windows handle time for every running application. You know, like it will give ~10ms of execution for each opened program in order to look like everything is running at the same time... So the preoblem is that if you need to Sleep() for let say only one millisecond, its possible that you'll be waiting in the end for about 11 ms because of the time given to each program... You get what I mean?
So I want to know if there was something, function, that could tell to the CPU: I really want to wait 1ms, not more!
Or some other function that would make it's running process more important, so that the CPU would almost only work for this appl and not on the other, like it could maybe run it for a second before switching to another app...
You get the idea? I'm sure there's a solution to that, because our actual video games have no problem handling fps!