How to enable/disable vsync without destroying renderer

How can I enable/disable vsync at runtime, without destroying the renderer? The HINT only works when creating a new renderer.

Is there another method?

I found the answer myself, it is SDL_GL_SetSwapInterval(1) to turn VSync ON, and SDL_GL_SetSwapInterval(0) to turn VSync Off.

It is documented here, I just couldn’t find it at first:

This will probably only work if the renderer uses OpenGL, though?
I think on Windows it uses Direct3D by default, and on macOS it will probably soon use Metal by default (or does it already?) because Apple is killing OpenGL.

I’m not aware of a proper solution for this, though

Nevertheless OpenGL will (presumably) still be available to be selected as the backend, by means of the SDL_HINT_RENDER_DRIVER hint. Notwithstanding Apple’s reputation there’s no suggestion (yet) that OpenGL will actually be removed or stop working, and of course it has a ‘special relationship’ with SDL2 in respect of the many SDL_GL_ functions.