Replaced Windows critical section with mutex - fixes some issues with window movement/resizing when using Direct3D output.

This commit is contained in:
SarahW 2016-08-28 20:31:12 +01:00
commit d27c7a0947
11 changed files with 22 additions and 25 deletions

View file

@ -70,8 +70,8 @@ static struct
int winsizex=640,winsizey=480;
int gfx_present[GFX_MAX];
#undef cs
CRITICAL_SECTION cs;
HANDLE ghMutex;
HANDLE mainthreadh;
@ -124,12 +124,12 @@ void releasemouse()
void startblit()
{
EnterCriticalSection(&cs);
WaitForSingleObject(ghMutex, INFINITE);
}
void endblit()
{
LeaveCriticalSection(&cs);
ReleaseMutex(ghMutex);
}
void leave_fullscreen()
@ -637,7 +637,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
/// QueryPerformanceCounter(&counter_posold);
// counter_posold.QuadPart*=100;
InitializeCriticalSection(&cs);
ghMutex = CreateMutex(NULL, FALSE, NULL);
mainthreadh=(HANDLE)_beginthread(mainthread,0,NULL);
SetThreadPriority(mainthreadh, THREAD_PRIORITY_HIGHEST);