diff --git a/Qt/qtemugl.cpp b/Qt/qtemugl.cpp index a70147884f..56b6eef1e8 100644 --- a/Qt/qtemugl.cpp +++ b/Qt/qtemugl.cpp @@ -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 *) diff --git a/native b/native index a02668cf8a..c00a47c892 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit a02668cf8a0167104513ea4fddcf3fe0a8b5572c +Subproject commit c00a47c8923a061ff970c0ba2b7ba9d73cb17a74