mirror of https://github.com/f4exb/sdrangel.git
Default to OpenGL 3.3 context on Mac, as we otherwise get 2.1
This commit is contained in:
parent
72dfe95a5b
commit
3335dd7cc0
19
app/main.cpp
19
app/main.cpp
|
@ -22,6 +22,8 @@
|
||||||
#include <QStyleFactory>
|
#include <QStyleFactory>
|
||||||
#include <QFontDatabase>
|
#include <QFontDatabase>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
|
#include <QGLFormat>
|
||||||
|
#include <QSurfaceFormat>
|
||||||
|
|
||||||
#include "loggerwithfile.h"
|
#include "loggerwithfile.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
@ -134,10 +136,19 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
// Enable WebGL in QtWebEngine when OpenGL is only version 2.1 (Needed for 3D Map)
|
// Request OpenGL 3.3 context, needed for glspectrum and 3D Map feature
|
||||||
// This can be removed when we eventually request a 4.1 OpenGL context
|
// Note that Mac only supports CoreProfile, so any deprecated OpenGL 2 features
|
||||||
// This needs to be executed before any other Qt code
|
// will not work. Because of this, we have two versions of the shaders:
|
||||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--ignore-gpu-blacklist");
|
// OpenGL 2 versions for compatiblity with older drivers and OpenGL 3.3
|
||||||
|
// versions for newer drivers
|
||||||
|
QGLFormat fmt;
|
||||||
|
fmt.setVersion(3, 3);
|
||||||
|
fmt.setProfile(QGLFormat::CoreProfile);
|
||||||
|
QGLFormat::setDefaultFormat(fmt);
|
||||||
|
QSurfaceFormat sfc;
|
||||||
|
sfc.setVersion(3, 3);
|
||||||
|
sfc.setProfile(QSurfaceFormat::CoreProfile);
|
||||||
|
QSurfaceFormat::setDefaultFormat(sfc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qtwebapp::LoggerWithFile *logger = new qtwebapp::LoggerWithFile(qApp);
|
qtwebapp::LoggerWithFile *logger = new qtwebapp::LoggerWithFile(qApp);
|
||||||
|
|
Loading…
Reference in New Issue