mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-22 22:01:06 -06:00
add VSync toggle
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user