Pass refresh rate if the screen size is the same as the monitor

This commit is contained in:
M374LX 2023-10-08 17:34:28 -03:00
parent 540f9409f5
commit 68f1b0e248

View File

@ -358,10 +358,19 @@ void ToggleFullscreen(void)
} }
else else
{ {
int monitorWidth = GetMonitorWidth(monitorIndex);
int monitorHeight = GetMonitorHeight(monitorIndex);
int refreshRate = GLFW_DONT_CARE;
if (CORE.Window.screen.width == monitorWidth && CORE.Window.screen.height == monitorHeight)
{
refreshRate = GetMonitorRefreshRate(refreshRate);
}
CORE.Window.fullscreen = true; CORE.Window.fullscreen = true;
CORE.Window.flags |= FLAG_FULLSCREEN_MODE; CORE.Window.flags |= FLAG_FULLSCREEN_MODE;
glfwSetWindowMonitor(platform.handle, monitor, 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE); glfwSetWindowMonitor(platform.handle, monitor, 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, refreshRate);
} }
} }