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 1007

Summary: Calling SDL_SetVideoMode() will reset existing timers
Product: SDL Reporter: Alexei Svitkine <alexei.svitkine>
Component: timerAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 1.2.14   
Hardware: Other   
OS: Linux   

Description Alexei Svitkine 2010-06-13 20:31:08 UTC
My application does the following:

SDL_Init(SDL_INIT_VIDEO)
SDL_SetVideoMode(...)
...
SDL_Init(SDL_INIT_TIMER)
SDL_AddTimer(...)
...
SDL_SetVideoMode(...)

After the last call to SetVideoMode(), all my previously registered timers will be lost - and GDB tells me that the timer thread ends. It seems SDL_SetVideoMode() ends up calling SDL_Init(), which somehow re-initializes the timer stuff and losing everything that was registered.
Comment 1 Alexei Svitkine 2010-07-18 14:05:53 UTC
Further testing revealed that this behaviour is cross-platform (MacOSX and Windows are also affected).
Comment 2 Sam Lantinga 2011-02-04 14:31:39 UTC
This is fixed in SDL 1.3.  Previously the timers were coupled to the event loop.

Thanks!