Use a semaphore object to synchronize rendering thread with the game
This commit is contained in:
parent
5192ebc44f
commit
a40282013b
6 changed files with 20 additions and 8 deletions
2
render.c
2
render.c
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue