Question about SDL_RENDERER_PRESENTVSYNC

Looks pretty conclusive ! :slight_smile:

1 Like

If you use SDL_GetDisplayMode() it will tell you the actual refresh rate(s) supported by your display.

Except that if I call SDL_GetCurrentDisplayMode() or SDL_GetDesktopDisplayMode() they both report 60 in the refresh_rate member, but in reality it’s 50 fps as can easily be confirmed by direct measurement and observation. So those APIs aren’t trustworthy.

That’s what’s reported by the operating system :man_shrugging:

Which, in turn, may be what is being reported by the TV via HDMI, but it’s still wrong and therefore useless! The only reliable way of determining the frame rate is to measure it directly, which is what I do and is what is reported in my screenshot above.

It’s best to support multiple framerates, because vsync isn’t always guaranteed to be 60Hz.
Here’s an example of frame rate independent movement: Lazy Foo' Productions - Frame Independent Movement