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 - VSync can not be reinitialized with another value
Summary: VSync can not be reinitialized with another value
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.14
Hardware: x86 Windows (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-24 00:29 UTC by Andrey Budko
Modified: 2011-08-21 08:57 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.