GLTeapot: wait for retrace.

Rendering at 200+fps is useless when your display can't handle it.
Now we can spin many more teapots while demo'ing Haiku without wasting
as much CPU.
This commit is contained in:
Adrien Destugues 2014-11-21 13:31:19 +01:00
parent 21e5fc49a7
commit d433a61aa2
1 changed files with 2 additions and 0 deletions

View File

@ -113,6 +113,7 @@ static int32
simonThread(void* cookie)
{
ObjectView* objectView = reinterpret_cast<ObjectView*>(cookie);
BScreen screen(objectView->Window());
int noPause = 0;
while (acquire_sem_etc(objectView->quittingSem, 1, B_TIMEOUT, 0) == B_NO_ERROR) {
@ -125,6 +126,7 @@ simonThread(void* cookie)
noPause = 0;
waitEvent(objectView->drawEvent);
}
screen.WaitForRetrace();
}
return 0;
}