From 3751c2b01475fdb7c40250f1116d84d55c31126f Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Wed, 13 Jan 2016 00:04:15 +0000 Subject: [PATCH] use SDL2 for Stopwatch class --- src/core/Stopwatch.cpp | 41 +++-------------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/src/core/Stopwatch.cpp b/src/core/Stopwatch.cpp index 18adb09742..cc875bb2d0 100644 --- a/src/core/Stopwatch.cpp +++ b/src/core/Stopwatch.cpp @@ -1,11 +1,4 @@ -#ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#include "../platform/platform.h" -#endif +#include #include "Stopwatch.hpp" @@ -80,40 +73,12 @@ void Stopwatch::Stop() uint64 Stopwatch::QueryFrequency() { -#ifdef _WIN32 - LARGE_INTEGER frequency; - if (QueryPerformanceFrequency(&frequency)) - { - return frequency.QuadPart; - } - else - { - log_error("QueryPerformanceFrequency failed."); - return 0; - } -#else - STUB(); - return 0; -#endif + return SDL_GetPerformanceFrequency(); } uint64 Stopwatch::QueryCurrentTicks() { -#ifdef _WIN32 - LARGE_INTEGER counter; - if (QueryPerformanceCounter(&counter)) - { - return counter.QuadPart; - } - else - { - log_error("QueryPerformanceCounter failed."); - return 0; - } -#else - STUB(); - return 0; -#endif + return SDL_GetPerformanceCounter(); } extern "C" {