mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 13:55:38 +00:00
SDL: Default to vsync, tab to disable
This commit is contained in:
parent
a216c8414c
commit
9d7fb64cdf
|
@ -88,11 +88,11 @@ bool SDLInterface::CreateGLContext()
|
|||
if (GLAD_GL_KHR_debug)
|
||||
{
|
||||
glad_glDebugMessageCallbackKHR(GLDebugCallback, nullptr);
|
||||
glEnable(GL_DEBUG_OUTPUT);
|
||||
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
||||
// glEnable(GL_DEBUG_OUTPUT);
|
||||
// glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
||||
}
|
||||
|
||||
SDL_GL_SetSwapInterval(0);
|
||||
SDL_GL_SetSwapInterval(1);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -277,6 +277,10 @@ bool SDLInterface::HandleSDLEvent(const SDL_Event* event)
|
|||
m_controller->SetButtonState(DigitalController::Button::Select, pressed);
|
||||
return true;
|
||||
|
||||
case SDL_SCANCODE_TAB:
|
||||
SDL_GL_SetSwapInterval(pressed ? 0 : 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -582,6 +586,8 @@ void SDLInterface::Run()
|
|||
|
||||
m_system->RunFrame();
|
||||
|
||||
Render();
|
||||
|
||||
// update fps counter
|
||||
{
|
||||
const double time = m_fps_timer.GetTimeSeconds();
|
||||
|
@ -595,7 +601,5 @@ void SDLInterface::Run()
|
|||
m_fps_timer.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
Render();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue