forked from speed-dreams/speed-dreams-code
Sets affinity to a single processor - needed for Windows Vista else rendering is jerky.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@112 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 96dd6e14b17d464feb18c49b7d160475f671ce05 Former-commit-id: b49033ca2875742c4e04ece9b9bd77aabf7eff3a
This commit is contained in:
parent
d5fa8d7774
commit
949730cae3
1 changed files with 20 additions and 0 deletions
|
@ -641,6 +641,24 @@ windowsTimeClock(void)
|
|||
return( D );
|
||||
}
|
||||
|
||||
static void
|
||||
windowsSetAffinity(void)
|
||||
{
|
||||
/* Restrict wtorcs.exe to one CPU core/processor - avoids jerky rendering
|
||||
* especially under Vista. */
|
||||
|
||||
HANDLE hProcess = GetCurrentProcess();
|
||||
ULONG_PTR ProcAM, SysAM;
|
||||
|
||||
GetProcessAffinityMask( hProcess, (PDWORD_PTR) &ProcAM, (PDWORD_PTR) &SysAM );
|
||||
if (ProcAM > 1)
|
||||
{
|
||||
ProcAM = 1;
|
||||
SetProcessAffinityMask( hProcess, ProcAM );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Function
|
||||
|
@ -673,6 +691,8 @@ WindowsSpecInit(void)
|
|||
GfOs.dirGetListFiltered = windowsDirGetListFiltered;
|
||||
GfOs.timeClock = windowsTimeClock;
|
||||
|
||||
windowsSetAffinity();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue