Please help me
PS. Sorry for my english ;p
Why do you want to limit the FPS?? If the reason is to control movement speed, then you probably want to switch your movement to be based on time passed instead of frames.konrad wrote:Hi, i have problem. What i can make fps limit??
Please help me
PS. Sorry for my english ;p
Code: Select all
ITimer* timer = device->getTimer();
timer->setTime(0);
while (device->run())
{
// Use timer->getTime() to get the time passed in milliseconds.
// When needed, use timer->setTime() to change it.
// As far as I know, the value returned from timer->getTime is only updated inside device->run().
if (time to update the game)
{
//do stuff
}
else if (time to render a frame)
{
//render a frame
}
}
True, monitors have limitations on how fast they display. VSync has it's limitations that Hybrid mentioned as well. And Yes, it is good to give up the processor so the computer can do what it needs to as well. In windows, a simple Sleep() can do it though. Your game more likely than not would be with full attention from the user. Games aren't really used in multitasking situations constantly. Sure, they run along office apps that people leave open, but when the game is on, it's pretty much the only intensive thing going. Everything else has much lower priority and doesn't need much processor time. So a Sleep(1) lets Windows know to give a quick time slice to other processes, such as AntiSpywares and things like that, besides the Windows core processes. But you don't have to limit to 60FPS to do it.eMgz wrote:i dont know how, but just for curiosity, its good to limit FPS so you dont waste time rendering useless frames (your monitor just show about 80 of them) and it prevents the graphics card from overheating.