We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5104 - Timer resolution should not be set to 1ms on default.
Summary: Timer resolution should not be set to 1ms on default.
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.12
Hardware: x86_64 Windows 10
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-22 22:16 UTC by Joel Linn
Modified: 2020-04-23 20:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Linn 2020-04-22 22:16:03 UTC
SDL_Init() initializes Ticks which sets the windows timer resolution to 1ms at default. timeBeginPeriod() is used for this. We call NtSetTimerResolution() before to set the resolution to a lower value and SDL overwrites this at default, which costs us decreased frame-rates. This behaviour can be turned off setting a Hint before calling SDL_Init() of course.

However, in SDL_hints.h it is elaborated that setting the timer resolution is a bad idea in many cases as well as:
> This hint is only used on Windows 7 and earlier.
From that I deduce timeBeginPreiod() should never be called on Windows 8 upwards, hence a bug report.