how to limit fps in glut ?

This topic is 1334 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

i have learn glut in 1 week

i don't know how to limit fps

Share on other sites

As far as I know GLUT doesn't have any way of enabling vsync. Maybe you should consider using a modern

library like GLFW or SDL. In GLFW you would call:

glfwSwapInterval(1);


Share on other sites

Minimal effort question = minimal effort answer.

http://lmgtfy.com/?q=glut+limit+fps

It needs to be said that you should beware of any recommendations in these results to use Sleep calls.

Sleep calls are appropriate if you want to reduce CPU load.

Sleep calls are not appropriate for controlling framerate.

And these two are not the same thing.

Share on other sites

Although you should be using VSYNC, you can do some waiting in-between frames if the game is essentially idle:

It is a little bit shameful how it is now on Windows...

Edited by Kaptein

• 16
• 11
• 9
• 49
• 12
• Forum Statistics

• Total Topics
631392
• Total Posts
2999737
×