Ensure swap interval

This commit is contained in:
Bruno Herbelin
2021-11-28 23:58:01 +01:00
parent 25fc5562db
commit 73d4f7c1ea

View File

@@ -635,12 +635,11 @@ void RenderingWindow::setFullscreen_(GLFWmonitor *mo)
const GLFWvidmode * mode = glfwGetVideoMode(mo);
glfwSetInputMode( window_, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
glfwSetWindowMonitor( window_, mo, 0, 0, mode->width, mode->height, mode->refreshRate);
// Enable vsync on output window only (i.e. not 0 if has a master)
// Workaround for disabled vsync in fullscreen (https://github.com/glfw/glfw/issues/1072)
glfwSwapInterval( nullptr == master_ ? 0 : Settings::application.render.vsync);
}
// Enable vsync on output window only (i.e. not 0 if has a master)
// Workaround for disabled vsync in fullscreen (https://github.com/glfw/glfw/issues/1072)
glfwSwapInterval( nullptr == master_ ? 0 : Settings::application.render.vsync);
}
@@ -783,7 +782,7 @@ bool RenderingWindow::init(int index, GLFWwindow *share)
}
else {
// Disable vsync on main window
// glfwSwapInterval(0);
glfwSwapInterval(0);
// Enable Antialiasing multisampling
if (Settings::application.render.multisampling > 0) {
glEnable(GL_MULTISAMPLE);