mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
sys_sdl_win.: call timeBeginPeriod(1) to set OS timer resolution to 1ms.
Works around buffer underruns with directsound and SDL2, but also will make Sleep()/SDL_Dleay() accurate to 1ms which should help framerate stability. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1200 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
bcd429b4e3
commit
4800fbde34
1 changed files with 12 additions and 0 deletions
|
@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <mmsystem.h>
|
||||
|
||||
#include "quakedef.h"
|
||||
|
||||
|
@ -204,10 +205,21 @@ static void Sys_SetDPIAware (void)
|
|||
FreeLibrary (hUser32);
|
||||
}
|
||||
|
||||
static void Sys_SetTimerResolution(void)
|
||||
{
|
||||
/* Set OS timer resolution to 1ms.
|
||||
Works around buffer underruns with directsound and SDL2, but also
|
||||
will make Sleep()/SDL_Dleay() accurate to 1ms which should help framerate
|
||||
stability.
|
||||
*/
|
||||
timeBeginPeriod (1);
|
||||
}
|
||||
|
||||
void Sys_Init (void)
|
||||
{
|
||||
OSVERSIONINFO vinfo;
|
||||
|
||||
Sys_SetTimerResolution ();
|
||||
Sys_SetDPIAware ();
|
||||
|
||||
memset (cwd, 0, sizeof(cwd));
|
||||
|
|
Loading…
Reference in a new issue