mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
Request desktop OpenGL compatibility profile at startup
The visualization framework requires desktop OpenGL with the fixed-function pipeline. Qt may otherwise create an OpenGL ES or core profile context on some platforms (e.g. Wayland/EGL on Ubuntu 26.04), causing all 3D rendering to fail with shader compile errors.
This commit is contained in:
committed by
Magne Sjaastad
parent
7e1c38bf99
commit
2443c4088d
@@ -38,6 +38,7 @@
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QSurfaceFormat>
|
||||
#include <QtGlobal>
|
||||
|
||||
#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();
|
||||
|
||||
Reference in New Issue
Block a user