mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 17:49:29 +01:00
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:
1 parent
508830b45b
commit
5263d53282
2 files changed
+10
-2
No files matched your search
+9
-1
@@ -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.
Reference in new issue
Block a user