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 - Calling SDL_SetVideoMode() will reset existing timers
Summary: Calling SDL_SetVideoMode() will reset existing timers
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: timer (show other bugs)
Version: 1.2.14
Hardware: Other Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-13 20:31 UTC by Alexei Svitkine
Modified: 2011-02-04 14:31 UTC (History)
0 users

See Also:


Attachments

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