A couple of ways to limit your frame-rate (pseudo Code) :
ATime := GetTime();
Render();
While (GetTime() - ATime) < TimePerFrame do
begin
Sleep(1);
{This will free up the CPU - tells the OS Scheduler it can do some other stuff NOTE : it's not garunteed to sleep for exactly 1ms, only garunteed to wait *at least* 1ms. it could sleep for 10ms in this example, for example.}
end;
You could use VSync on it's own - that'll just wait on GL Swap Buffer if it's called before it's time for the next frame but the above method offers more control. You should leave VSync enabled regardless, if you want to measure performance it's much better to time how long Render(); takes rather than seeing what your max FPS is.
Bookmarks