Skip to content

Commit

Permalink
OpenGL: Windows - fall back to software renderer if OpenGL < 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xiphon committed May 20, 2020
1 parent c20a0ef commit c946905
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
#include "daemon/DaemonManager.h"
#endif

#if defined(Q_OS_WIN)
#include <QOpenGLContext>
#endif

#ifdef WITH_SCANNER
#include "QR-Code-scanner/QrCodeScanner.h"
#endif
Expand Down Expand Up @@ -179,6 +183,17 @@ int main(int argc, char *argv[])

MainApp app(argc, argv);

#if defined(Q_OS_WIN)
if (isOpenGL)
{
QOpenGLContext ctx;
isOpenGL = ctx.create() && ctx.format().version() >= qMakePair(2, 1);
if (!isOpenGL) {
qputenv("QMLSCENE_DEVICE", "softwarecontext");
}
}
#endif

app.setApplicationName("monero-core");
app.setOrganizationDomain("getmonero.org");
app.setOrganizationName("monero-project");
Expand Down

0 comments on commit c946905

Please sign in to comment.