From 058fc2824880077e9798f5e1bb501ed5f289dbe5 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 11 Oct 2019 16:17:17 +1000 Subject: [PATCH] Frontend: Sync to audio --- src/duckstation/sdl_interface.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/duckstation/sdl_interface.cpp b/src/duckstation/sdl_interface.cpp index a4d9989ff..d0c2370ee 100644 --- a/src/duckstation/sdl_interface.cpp +++ b/src/duckstation/sdl_interface.cpp @@ -184,6 +184,7 @@ bool SDLInterface::CreateAudioStream() return false; } + m_audio_stream->SetSync(false); return true; } @@ -330,12 +331,17 @@ bool SDLInterface::HandleSDLEvent(const SDL_Event* event) case SDL_SCANCODE_TAB: { +#if 1 + // sync to audio + m_audio_stream->SetSync(!pressed); +#else // Window framebuffer has to be bound to call SetSwapInterval. GLint current_fbo = 0; glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); SDL_GL_SetSwapInterval(pressed ? 0 : 1); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, current_fbo); +#endif } break;