mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
We don't need to initialize the SDL timer subsystem to use SDL_Delay, and initializing it causes SDL to create a worker thread (which it uses for SDL_AddTimer and friends, which we don't use).
This commit is contained in:
@@ -34,15 +34,12 @@ namespace sdl
|
|||||||
|
|
||||||
Timer::Timer()
|
Timer::Timer()
|
||||||
{
|
{
|
||||||
// Init the SDL timer system (needed for SDL_Delay.)
|
// We don't need to initialize the SDL timer subsystem for SDL_Delay to
|
||||||
if (SDL_InitSubSystem(SDL_INIT_TIMER) < 0)
|
// function - and doing so causes SDL to create a worker thread.
|
||||||
throw love::Exception("Could not initialize SDL timer subsystem (%s)", SDL_GetError());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer::~Timer()
|
Timer::~Timer()
|
||||||
{
|
{
|
||||||
// Quit SDL timer.
|
|
||||||
SDL_QuitSubSystem(SDL_INIT_TIMER);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *Timer::getName() const
|
const char *Timer::getName() const
|
||||||
|
|||||||
Reference in New Issue
Block a user