mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-19 02:22:01 +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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1200 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
ff6a179844
commit
7f9d335967
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
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <mmsystem.h>
|
||||||
|
|
||||||
#include "quakedef.h"
|
#include "quakedef.h"
|
||||||
|
|
||||||
|
@ -204,10 +205,21 @@ static void Sys_SetDPIAware (void)
|
||||||
FreeLibrary (hUser32);
|
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)
|
void Sys_Init (void)
|
||||||
{
|
{
|
||||||
OSVERSIONINFO vinfo;
|
OSVERSIONINFO vinfo;
|
||||||
|
|
||||||
|
Sys_SetTimerResolution ();
|
||||||
Sys_SetDPIAware ();
|
Sys_SetDPIAware ();
|
||||||
|
|
||||||
memset (cwd, 0, sizeof(cwd));
|
memset (cwd, 0, sizeof(cwd));
|
||||||
|
|
Loading…
Reference in a new issue