Merge pull request #684 from twvd/msg

Prevent selecting Vulkan renderer in Qt frontend and present a message
This commit is contained in:
wheremyfoodat
2024-12-12 22:50:30 +02:00
committed by GitHub

View File

@@ -190,8 +190,18 @@ ConfigWindow::ConfigWindow(ConfigCallback configCallback, MainWindowCallback win
rendererType->addItem(tr("Vulkan")); rendererType->addItem(tr("Vulkan"));
rendererType->setCurrentIndex(static_cast<int>(config.rendererType)); rendererType->setCurrentIndex(static_cast<int>(config.rendererType));
connect(rendererType, &QComboBox::currentIndexChanged, this, [&](int index) { connect(rendererType, &QComboBox::currentIndexChanged, this, [&](int index) {
config.rendererType = static_cast<RendererType>(index); auto type = static_cast<RendererType>(index);
updateConfig();
if (type == RendererType::Vulkan) {
QMessageBox messageBox(
QMessageBox::Icon::Critical, tr("Vulkan renderer unavailable"),
tr("Qt UI doesn't currently support Vulkan, try again at a later time")
);
messageBox.exec();
} else {
config.rendererType = type;
updateConfig();
}
}); });
gpuLayout->addRow(tr("GPU renderer"), rendererType); gpuLayout->addRow(tr("GPU renderer"), rendererType);