I have an SDL/OpenGL program which creates a rendering context with PRESENTVSYNC
enabled, then enters an animation loop which calls SDL_GL_SwapWindow
each time around. On my own machine, the animation works fine at a sensible speed, but on my office machine it runs with no vsync delay at all resulting in the animation running at breakneck speed and tearing all over the frame. Adding a sleep() to the animation loop slows it down sensibly.
I know that I can use SDL_GL_GetSwapInterval
to see if swapping is being synchronized or not, but is there a way to find out what the actual refresh rate of the screen is in order to know how long or short the sleep should be?