bootmanager: set the surface format based on vsync

This commit is contained in:
Vitor Kiguchi 2023-04-03 14:21:49 -03:00
parent 5c50a26b38
commit b4ef3cdeff
1 changed files with 5 additions and 1 deletions

View File

@ -162,7 +162,7 @@ public:
// disable vsync for any shared contexts
auto format = share_context->format();
format.setSwapInterval(main_surface ? Settings::values.use_vsync_new.GetValue() : 0);
format.setSwapInterval(0);
context = std::make_unique<QOpenGLContext>();
context->setShareContext(share_context);
@ -673,6 +673,10 @@ bool GRenderWindow::InitializeOpenGL() {
auto child_context = CreateSharedContext();
child->SetContext(std::move(child_context));
auto format = child_widget->windowHandle()->format();
format.setSwapInterval(Settings::values.use_vsync_new.GetValue());
child_widget->windowHandle()->setFormat(format);
return true;
#else
QMessageBox::warning(this, tr("OpenGL not available!"),