mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-03 21:41:19 +12:00
GeneralSettings: Update vsync after settings close (#401)
This commit is contained in:
parent
f41f7b63e8
commit
c3182aedd9
6 changed files with 34 additions and 29 deletions
|
@ -352,14 +352,19 @@ void OpenGLRenderer::NotifyLatteCommandProcessorIdle()
|
|||
glFlush();
|
||||
}
|
||||
|
||||
void OpenGLRenderer::EnableVSync(int state)
|
||||
void OpenGLRenderer::UpdateVSyncState()
|
||||
{
|
||||
int configValue = GetConfig().vsync.GetValue();
|
||||
if(m_activeVSyncState != configValue)
|
||||
{
|
||||
#if BOOST_OS_WINDOWS
|
||||
if(wglSwapIntervalEXT)
|
||||
wglSwapIntervalEXT(state); // 1 = enabled, 0 = disabled
|
||||
if(wglSwapIntervalEXT)
|
||||
wglSwapIntervalEXT(configValue); // 1 = enabled, 0 = disabled
|
||||
#else
|
||||
cemuLog_log(LogType::Force, "OpenGL vsync not implemented");
|
||||
cemuLog_log(LogType::Force, "OpenGL vsync not implemented");
|
||||
#endif
|
||||
m_activeVSyncState = configValue;
|
||||
}
|
||||
}
|
||||
|
||||
bool IsRunningInWine();
|
||||
|
@ -438,6 +443,7 @@ void OpenGLRenderer::EnableDebugMode()
|
|||
void OpenGLRenderer::SwapBuffers(bool swapTV, bool swapDRC)
|
||||
{
|
||||
GLCanvas_SwapBuffers(swapTV, swapDRC);
|
||||
UpdateVSyncState();
|
||||
|
||||
if (swapTV)
|
||||
cleanupAfterFrame();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue