Skip to content
Permalink
Browse files

Merge pull request #12254 from KentuckyCompass/qt-opengl-fix-core

Configure QT to get a higher version for opengl
  • Loading branch information...
hrydgard committed Aug 18, 2019
2 parents 2857e0f + 5955861 commit 044dd03b3275501d9020e609e3391c56d6bb8d48
Showing with 10 additions and 0 deletions.
  1. +10 −0 Qt/QtMain.cpp
@@ -439,6 +439,8 @@ void MainUI::initializeGL() {
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
}

SetGLCoreContext(format().profile() == QGLFormat::CoreProfile);

#ifndef USING_GLES2
// Some core profile drivers elide certain extensions from GL_EXTENSIONS/etc.
// glewExperimental allows us to force GLEW to search for the pointers anyway.
@@ -569,6 +571,14 @@ int main(int argc, char *argv[])
#if defined(Q_OS_LINUX)
QApplication::setAttribute(Qt::AA_X11InitThreads, true);
#endif

// Qt would otherwise default to a 3.0 compatibility profile
// except on Nvidia, where Nvidia gives us the highest supported anyway
QGLFormat format;
format.setVersion(4, 6);
format.setProfile(QGLFormat::CoreProfile);
QGLFormat::setDefaultFormat(format);

QApplication a(argc, argv);
QSize res = QApplication::desktop()->screenGeometry().size();
if (res.width() < res.height())

0 comments on commit 044dd03

Please sign in to comment.
You can’t perform that action at this time.