Commit 5d1c04a3 authored by Martin Schultz's avatar Martin Schultz

added settings in the options widget for OpenGL Profile and version

also added the actually reported values to the options widget to detect
driver issues. llvmpipe software rendering supports 3.3 core profiles
and openflipper can be run with llvmpipe
parent a2cc7ba5
......@@ -77,7 +77,29 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
// Files
connect(pbReloadShaders,SIGNAL(clicked()),this,SLOT(slotReloadShaders()));
// OpenGL versions
VersionComboBox->clear();
VersionComboBox->addItem("4.6",QVariant::fromValue(QPair<int, int>(4,6)));
VersionComboBox->addItem("4.5",QVariant::fromValue(QPair<int, int>(4,5)));
VersionComboBox->addItem("4.4",QVariant::fromValue(QPair<int, int>(4,4)));
VersionComboBox->addItem("4.3",QVariant::fromValue(QPair<int, int>(4,3)));
VersionComboBox->addItem("4.2",QVariant::fromValue(QPair<int, int>(4,2)));
VersionComboBox->addItem("4.1",QVariant::fromValue(QPair<int, int>(4,1)));
VersionComboBox->addItem("4.0",QVariant::fromValue(QPair<int, int>(4,0)));
VersionComboBox->addItem("3.3",QVariant::fromValue(QPair<int, int>(3,3)));
VersionComboBox->addItem("3.2",QVariant::fromValue(QPair<int, int>(3,2)));
VersionComboBox->addItem("3.1",QVariant::fromValue(QPair<int, int>(3,1)));
VersionComboBox->addItem("3.0",QVariant::fromValue(QPair<int, int>(3,0)));
VersionComboBox->addItem("2.1",QVariant::fromValue(QPair<int, int>(2,1)));
VersionComboBox->addItem("2.0",QVariant::fromValue(QPair<int, int>(2,0)));
VersionComboBox->addItem("1.5",QVariant::fromValue(QPair<int, int>(1,5)));
VersionComboBox->addItem("1.4",QVariant::fromValue(QPair<int, int>(1,4)));
VersionComboBox->addItem("1.3",QVariant::fromValue(QPair<int, int>(1,3)));
VersionComboBox->addItem("1.2",QVariant::fromValue(QPair<int, int>(1,2)));
VersionComboBox->addItem("1.1",QVariant::fromValue(QPair<int, int>(1,1)));
VersionComboBox->addItem("1.0",QVariant::fromValue(QPair<int, int>(1,0)));
// Viewer Settings
connect( restrictFPS, SIGNAL(toggled(bool)), FPS, SLOT(setEnabled(bool)) );
connect( viewerList, SIGNAL(currentRowChanged(int)), this, SLOT(updateViewerSettings(int)) );
......@@ -270,6 +292,37 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
//OpenGL
samples_spinBox->setValue(OpenFlipper::Options::samples());
QPalette warning = samplesWarning->palette();
samplesWarning->setText(QString::number(QOpenGLContext::currentContext()->format().samples()));
if(OpenFlipper::Options::samples() != QOpenGLContext::currentContext()->format().samples())
warning.setColor(samplesWarning->foregroundRole(),Qt::red);
else
warning.setColor(samplesWarning->foregroundRole(),Qt::black);
samplesWarning->setPalette(warning);
VersionComboBox->setCurrentIndex( VersionComboBox->findData(QVariant::fromValue(OpenFlipper::Options::glVersion())));
QPalette version = versionWarning->palette();
versionWarning->setText(QString("%1.%2").arg(QOpenGLContext::currentContext()->format().version().first)
.arg(QOpenGLContext::currentContext()->format().version().second));
if(OpenFlipper::Options::glVersion() != QOpenGLContext::currentContext()->format().version())
version.setColor(versionWarning->foregroundRole(),Qt::red);
else
version.setColor(versionWarning->foregroundRole(),Qt::black);
versionWarning->setPalette(version);
QPalette profile = profileWarning->palette();
profileComboBox->setCurrentIndex(OpenFlipper::Options::coreProfile()?0:1);
if(QOpenGLContext::currentContext()->format().profile() == QSurfaceFormat::CoreProfile)
profileWarning->setText("Core");
if(QOpenGLContext::currentContext()->format().profile() == QSurfaceFormat::CompatibilityProfile)
profileWarning->setText("Compatibility");
if(QOpenGLContext::currentContext()->format().profile() == QSurfaceFormat::NoProfile)
profileWarning->setText("None");
if(OpenFlipper::Options::coreProfile() && QOpenGLContext::currentContext()->format().profile() != QSurfaceFormat::CoreProfile)
profile.setColor(profileWarning->foregroundRole(),Qt::red);
else
profile.setColor(profileWarning->foregroundRole(),Qt::black);
profileWarning->setPalette(profile);
//Files
logFile->setText( OpenFlipperSettings().value("Core/Log/logFile").toString() );
......@@ -585,6 +638,8 @@ void OptionsWidget::slotApply() {
//OpenGL settings
OpenFlipperSettings().setValue("Core/OpenGL/Samples",samples_spinBox->value());
OpenFlipper::Options::glVersion(VersionComboBox->currentData().value<QPair<int,int>>());
OpenFlipper::Options::coreProfile(profileComboBox->currentIndex() == 0);
//Paths settings
OpenFlipperSettings().setValue("Core/File/MaxRecent",maxRecentBox->value() ) ;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment