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

@ -87,7 +87,7 @@ DWORD WINAPI render_main(void)
glEnable(GL_TEXTURE_2D);
while(ddraw->render.run)
while(ddraw->render.run && WaitForSingleObject(ddraw->render.sem, INFINITE) == WAIT_OBJECT_0)
{
scale_w = (float)ddraw->width/tex_width;
scale_h = (float)ddraw->height/tex_height;