Use a semaphore object to synchronize rendering thread with the game

This commit is contained in:
Toni Spets 2011-06-29 22:47:29 +03:00
parent 5192ebc44f
commit a40282013b
6 changed files with 20 additions and 8 deletions

View file

@ -50,7 +50,7 @@ DWORD WINAPI render_soft_main(void)
frame_len = 1000.0f / ddraw->render.maxfps;
}
while (ddraw->render.run)
while (ddraw->render.run && WaitForSingleObject(ddraw->render.sem, INFINITE) == WAIT_OBJECT_0)
{
if(ddraw->render.maxfps > 0)
{