diff options
Diffstat (limited to 'src/libui_sdl/main.cpp')
-rw-r--r-- | src/libui_sdl/main.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 1b4a9c6..24febf6 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -988,7 +988,8 @@ int EmuThreadFunc(void* burp) uiAreaQueueRedrawAll(MainDrawArea); bool limitfps = Config::LimitFPS && !HotkeyDown(HK_FastForward); - SPU::Sync(limitfps); + bool vsync = Config::ScreenVSync && Screen_UseGL; + SPU::Sync(limitfps || vsync); float framerate = (1000.0f * nlines) / (60.0f * 263.0f); @@ -2260,6 +2261,19 @@ void ApplyNewSettings(int type) GPU3D::InitRenderer(Screen_UseGL); if (Screen_UseGL) uiGLMakeContextCurrent(NULL); } + else if (type == 4) // vsync + { + if (Screen_UseGL) + { + uiGLMakeContextCurrent(GLContext); + uiGLSetVSync(Config::ScreenVSync); + uiGLMakeContextCurrent(NULL); + } + else + { + // TODO eventually: VSync for non-GL screen? + } + } EmuRunning = prevstatus; } @@ -2469,7 +2483,7 @@ void CreateMainWindow(bool opengl) if (opengl_good) { uiGLMakeContextCurrent(GLContext); - uiGLSetVSync(0); // TODO: make configurable? + uiGLSetVSync(Config::ScreenVSync); if (!GLScreen_Init()) opengl_good = false; if (opengl_good) { |