mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Better framerate throttling in UI
This commit is contained in:
parent
422f08721d
commit
d33465a56c
1 changed files with 5 additions and 1 deletions
|
@ -107,6 +107,7 @@ void Core_RunLoop()
|
||||||
{
|
{
|
||||||
while (!coreState) {
|
while (!coreState) {
|
||||||
time_update();
|
time_update();
|
||||||
|
double startTime = time_now_d();
|
||||||
UpdateScreenScale();
|
UpdateScreenScale();
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -129,10 +130,13 @@ void Core_RunLoop()
|
||||||
EndInputState(&input_state);
|
EndInputState(&input_state);
|
||||||
}
|
}
|
||||||
NativeRender();
|
NativeRender();
|
||||||
|
time_update();
|
||||||
// Simple throttling to not burn the GPU in the menu.
|
// Simple throttling to not burn the GPU in the menu.
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (globalUIState != UISTATE_INGAME) {
|
if (globalUIState != UISTATE_INGAME) {
|
||||||
Sleep(15);
|
double sleepTime = 16.666 - (time_now_d() - startTime) * 1000.0;
|
||||||
|
if (sleepTime > 0.0)
|
||||||
|
Sleep((int)sleepTime);
|
||||||
GL_SwapBuffers();
|
GL_SwapBuffers();
|
||||||
} else if (!Core_IsStepping()) {
|
} else if (!Core_IsStepping()) {
|
||||||
GL_SwapBuffers();
|
GL_SwapBuffers();
|
||||||
|
|
Loading…
Add table
Reference in a new issue