🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
NeHe SDK and CPU usage
Using main loop program similar (or equal) to standard NeHe SDK loop seems to cause serious overusage of CPU. According to Windows monitoring the program, even if it was just a normal Tetris - eats all the CPU power it can get. Normally I wouldn't bother, but with faster CPUs of today this results serious heat build-up.
I tried to do some sort of hack to limit the programs CPU usage through capping the FPS:
// get tick counts for timing and cap the FPS tp 60
while (currentTickCount-lastTickCount < 16)
{
currentTickCount = GetTickCount ();
}
...but it naturally didn't help, as now the CPU doesn't do the program but the loop, still wasting CPU resources. Does anyone know a solid solution to do this properly??
if you are capping the fps inside your main loop with:
while (currentTickCount-lastTickCount <
while (currentTickCount-lastTickCount <
mmm post didnt show up correctly ... change the while with an if and thats all. also there are better methods to cap the fps
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement