Implement throttling for Qt desktop UI (same as the Windows-only one in Core/Config) to stop it using 100% cpu in menus.

This commit is contained in:
Sacha committed 2013-11-05 10:54:37 +10:00
1 parent 508830b45b
commit 5263d53282
2 files changed
+10 -2

No files matched your search

+9 -1
View File
@@ -24,11 +24,19 @@ void QtEmuGL::initializeGL()
}
void QtEmuGL::paintGL()
{
static double startTime = 0;
NativeUpdate(*input_state);
NativeRender();
EndInputState(input_state);
time_update();
if (globalUIState != UISTATE_INGAME && globalUIState != UISTATE_EXIT) {
time_update();
double diffTime = time_now_d() - startTime;
startTime = time_now_d();
int sleepTime = (int) (1000000.0 / 60.0) - (int) (diffTime * 1000000.0);
if (sleepTime > 0)
usleep(sleepTime);
}
}
void QtEmuGL::mouseDoubleClickEvent(QMouseEvent *)
+1 -1
Submodule native updated: a02668cf8a...c00a47c892.