@@ -163,7 +163,7 @@ bool Backend::Initialize(const char* window_name, int width, int height, bool al
{
RMLUI_ASSERT(!data);
- if (SDL_Init(SDL_INIT_VIDEO) != 0)
+ if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS | SDL_INIT_TIMER) != 0)
return false;
// Submit click events when focusing the window.
@@ -123,7 +123,7 @@ bool Backend::Initialize(const char* window_name, int width, int height, bool al
@@ -56,7 +56,7 @@ bool Backend::Initialize(const char* window_name, int width, int height, bool al
@@ -62,7 +62,9 @@ void SystemInterface_SDL::SetWindow(SDL_Window* in_window)
double SystemInterface_SDL::GetElapsedTime()
- return double(SDL_GetTicks()) / 1000.0;
+ static const Uint64 start = SDL_GetPerformanceCounter();
+ static const double frequency = double(SDL_GetPerformanceFrequency());
+ return double(SDL_GetPerformanceCounter() - start) / frequency;
}
void SystemInterface_SDL::SetMouseCursor(const Rml::String& cursor_name)