mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-02-06 14:25:39 +00:00
Frontend: Sync to audio
This commit is contained in:
parent
a3446b8275
commit
058fc28248
|
@ -184,6 +184,7 @@ bool SDLInterface::CreateAudioStream()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_audio_stream->SetSync(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,12 +331,17 @@ bool SDLInterface::HandleSDLEvent(const SDL_Event* event)
|
||||||
|
|
||||||
case SDL_SCANCODE_TAB:
|
case SDL_SCANCODE_TAB:
|
||||||
{
|
{
|
||||||
|
#if 1
|
||||||
|
// sync to audio
|
||||||
|
m_audio_stream->SetSync(!pressed);
|
||||||
|
#else
|
||||||
// Window framebuffer has to be bound to call SetSwapInterval.
|
// Window framebuffer has to be bound to call SetSwapInterval.
|
||||||
GLint current_fbo = 0;
|
GLint current_fbo = 0;
|
||||||
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo);
|
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo);
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||||
SDL_GL_SetSwapInterval(pressed ? 0 : 1);
|
SDL_GL_SetSwapInterval(pressed ? 0 : 1);
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, current_fbo);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, current_fbo);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue