Win32: Remove timeGetTime fallback for timer

The performance counter API is guaranteed to succeed on Windows XP and
later so there is no need for a fallback.

This removes our last dependency on winmm.
This commit is contained in:
Camilla Löwy
2021-07-18 21:24:15 +02:00
parent 35f3b58c21
commit b6834bf2a1
3 changed files with 4 additions and 44 deletions
+4 -20
View File
@@ -36,30 +36,14 @@
void _glfwPlatformInitTimer(void)
{
uint64_t frequency;
if (QueryPerformanceFrequency((LARGE_INTEGER*) &frequency))
{
_glfw.timer.win32.hasPC = GLFW_TRUE;
_glfw.timer.win32.frequency = frequency;
}
else
{
_glfw.timer.win32.hasPC = GLFW_FALSE;
_glfw.timer.win32.frequency = 1000;
}
QueryPerformanceFrequency((LARGE_INTEGER*) &_glfw.timer.win32.frequency);
}
uint64_t _glfwPlatformGetTimerValue(void)
{
if (_glfw.timer.win32.hasPC)
{
uint64_t value;
QueryPerformanceCounter((LARGE_INTEGER*) &value);
return value;
}
else
return (uint64_t) timeGetTime();
uint64_t value;
QueryPerformanceCounter((LARGE_INTEGER*) &value);
return value;
}
uint64_t _glfwPlatformGetTimerFrequency(void)