Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions openhantek/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+

#include <QtGlobal>
#include <QApplication>
#include <QCommandLineParser>
#include <QDebug>
Expand Down Expand Up @@ -92,19 +93,34 @@ int main(int argc, char *argv[]) {
#endif

bool useGles = false;
bool forceSl150 = false;
{
QCoreApplication parserApp(argc, argv);
QCommandLineParser p;
p.addHelpOption();
p.addVersionOption();

QCommandLineOption useGlesOption("useGLES", QCoreApplication::tr("Use OpenGL ES instead of OpenGL"));
p.addOption(useGlesOption);

QCommandLineOption forceSl150Option("forceSL150", QCoreApplication::tr("Force OpenGL Shader Language version 1.50"));
p.addOption(forceSl150Option);

p.process(parserApp);
useGles = p.isSet(useGlesOption);
forceSl150 = p.isSet(forceSl150Option);
}

GlScope::fixOpenGLversion(useGles ? QSurfaceFormat::OpenGLES : QSurfaceFormat::OpenGL);

if (forceSl150) {
// set environment variables for Qt
qputenv("MESA_GL_VERSION_OVERRIDE", "3.2");
qputenv("MESA_GLSL_VERSION_OVERRIDE", "150");
qDebug() << "MESA_GL_VERSION_OVERRIDE =" << qgetenv("MESA_GL_VERSION_OVERRIDE").constData();
qDebug() << "MESA_GLSL_VERSION_OVERRIDE =" << qgetenv("MESA_GLSL_VERSION_OVERRIDE").constData();
}

QApplication openHantekApplication(argc, argv);

//////// Load translations ////////
Expand Down