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:
@@ -113,6 +113,7 @@ static int32
|
|||||||
simonThread(void* cookie)
|
simonThread(void* cookie)
|
||||||
{
|
{
|
||||||
ObjectView* objectView = reinterpret_cast<ObjectView*>(cookie);
|
ObjectView* objectView = reinterpret_cast<ObjectView*>(cookie);
|
||||||
|
BScreen screen(objectView->Window());
|
||||||
|
|
||||||
int noPause = 0;
|
int noPause = 0;
|
||||||
while (acquire_sem_etc(objectView->quittingSem, 1, B_TIMEOUT, 0) == B_NO_ERROR) {
|
while (acquire_sem_etc(objectView->quittingSem, 1, B_TIMEOUT, 0) == B_NO_ERROR) {
|
||||||
@@ -125,6 +126,7 @@ simonThread(void* cookie)
|
|||||||
noPause = 0;
|
noPause = 0;
|
||||||
waitEvent(objectView->drawEvent);
|
waitEvent(objectView->drawEvent);
|
||||||
}
|
}
|
||||||
|
screen.WaitForRetrace();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user