diff --git a/ApplicationExeCode/RiaMain.cpp b/ApplicationExeCode/RiaMain.cpp index 2cb52db35c..c1fb320b96 100644 --- a/ApplicationExeCode/RiaMain.cpp +++ b/ApplicationExeCode/RiaMain.cpp @@ -38,6 +38,7 @@ #include "cvfqtUtils.h" #include +#include #include #ifndef WIN32 @@ -124,6 +125,16 @@ int main( int argc, char* argv[] ) // See test application QtTestBenchOpenGLWidget QApplication::setAttribute( Qt::AA_ShareOpenGLContexts ); + // The visualization framework requires desktop OpenGL with the fixed-function pipeline. Request + // this explicitly, as Qt may otherwise create an OpenGL ES or core profile context on some + // platforms (e.g. Wayland/EGL), causing all 3D rendering to fail. + { + QSurfaceFormat surfaceFormat = QSurfaceFormat::defaultFormat(); + surfaceFormat.setRenderableType( QSurfaceFormat::OpenGL ); + surfaceFormat.setProfile( QSurfaceFormat::CompatibilityProfile ); + QSurfaceFormat::setDefaultFormat( surfaceFormat ); + } + // Create feature manager before the application object is created RiaMainTools::initializeSingletons(); RiaQuantityInfoTools::initializeSummaryKeywords();