We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1211

Summary: VSync can not be reinitialized with another value
Product: SDL Reporter: Andrey Budko <e6y>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: 1.2.14   
Hardware: x86   
OS: Windows (All)   

Description Andrey Budko 2011-05-24 00:29:48 UTC
Something like that:

SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
screen = SDL_SetVideoMode(...)
SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL, &temp); // temp is 1

bla bla

SDL_FreeSurface(screen);

SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0);
screen = SDL_SetVideoMode(...)
SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL, &temp); // temp is 1
Comment 1 Ryan C. Gordon 2011-08-21 08:57:03 UTC
Don't call SDL_FreeSurface(screen) ... if you replace that with...

    SDL_QuitSubSystem(SDL_INIT_VIDEO);
    SDL_Init(SDL_INIT_VIDEO);

...then the problem should be fixed.

(In SDL 1.3, we have a proper API for toggling vsync on existing windows.)

--ryan.