I have learn OpenGL programming for some time.And I found a very strange phenomenon : my FPS(Frame per Second) always stays about 60,no matter the program is very easy or a litt
What @Thomas said, it's VSync.
You can disable it in your applicaton using:
glfwSwapInterval(0);
(0
= off, 1
= on)SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0);
In the nVidia Control Panel
:
The vertical sync setting is the one you care about. For benchmarks like this, you normally want it set to off
.
This is vsync at work. Your monitor runs at 60 Hz, so there's no point in rendering more frames. And by limiting the framerate in that way, there will be no tearing artifacts.
Probably there is a setting in your driver's control panel to enable or disable vsync forcefully, or to leave it up to the application.
If you use an OpenGL framework like GLUT or GLFW, that probably also has an option to explicitly request vsync, or to turn it off (which is useful for benchmarking). Not all drivers/settings will honour this, though.