The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Enabling and disabling vSync after renderer creation
Xriuk


Joined: 27 Dec 2015
Posts: 4
I have an SDL_Renderer which I set to use or not use vSync (depending on the user). In my options menu I have an option for enabling/disabling vSync. Can I edit my renderer to update the vSync preferences so that I don't have to destroy and recreate it? Doing so would invalidate a lot of renderer pointers in my game, so I would like to find an alternative solution.
Treble


Joined: 11 Dec 2015
Posts: 10
By the looks of it, no, it doesn't seem like this is possible.
Xriuk


Joined: 27 Dec 2015
Posts: 4
I'm really disappointed by this. It's not possible to edit vsync after renderer creation and it's not possible to destroy and re-create the renderer since this would destroy every texture created...
MrTAToad


Joined: 13 Feb 2014
Posts: 205
Location: Chichester, England
Have you tried the SDL_HINT_RENDER_VSYNC hint ? By the looks of it, it overwrites the CreateRender option, and thus should work fine after the function is used.
Xriuk


Joined: 27 Dec 2015
Posts: 4
MrTAToad wrote:
Have you tried the SDL_HINT_RENDER_VSYNC hint ? By the looks of it, it overwrites the CreateRender option, and thus should work fine after the function is used.

Yes I tried that, not working. Plus the wiki clearly states that it overwrites the CreateRender option only inside the function itself.
SDLer


Joined: 10 Aug 2013
Posts: 9
I just needed to do this myself, and I was very surprised and just like Xriuk disappointed this was not possible.

Is there anyway to suggest it as a change for a future SDL versions ?