QueryPerformanceCounter() is reliable these days, and setting the timer frequency higher can have adverse power consequences.
dd757624
%28v=vs.85%29.aspx
This commit is contained in:
parent
0e9ba88315
commit
98819d0d8d
1 changed files with 4 additions and 4 deletions
|
@ -48,13 +48,13 @@ SDL_StartTicks(void)
|
||||||
#ifdef USE_GETTICKCOUNT
|
#ifdef USE_GETTICKCOUNT
|
||||||
start = GetTickCount();
|
start = GetTickCount();
|
||||||
#else
|
#else
|
||||||
#if 0 /* Apparently there are problems with QPC on Win2K */
|
/* QueryPerformanceCounter has had problems in the past, but lots of games
|
||||||
|
use it, so we'll rely on it here.
|
||||||
|
*/
|
||||||
if (QueryPerformanceFrequency(&hires_ticks_per_second) == TRUE) {
|
if (QueryPerformanceFrequency(&hires_ticks_per_second) == TRUE) {
|
||||||
hires_timer_available = TRUE;
|
hires_timer_available = TRUE;
|
||||||
QueryPerformanceCounter(&hires_start_ticks);
|
QueryPerformanceCounter(&hires_start_ticks);
|
||||||
} else
|
} else {
|
||||||
#endif
|
|
||||||
{
|
|
||||||
hires_timer_available = FALSE;
|
hires_timer_available = FALSE;
|
||||||
timeBeginPeriod(1); /* use 1 ms timer precision */
|
timeBeginPeriod(1); /* use 1 ms timer precision */
|
||||||
start = timeGetTime();
|
start = timeGetTime();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue