From d00288198f14d9179c7983148812f2956299a54e Mon Sep 17 00:00:00 2001 From: Adrian Jeakins Date: Wed, 1 May 2019 21:32:48 +0100 Subject: Bring back check that GL contexts get the format requested. --- gui/application.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gui/application.cc b/gui/application.cc index 3cf8081d..9229f1cd 100644 --- a/gui/application.cc +++ b/gui/application.cc @@ -20,6 +20,8 @@ */ #include "application.h" +#include "log.h" +#include #include #include #include @@ -47,6 +49,17 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) fmt.setMajorVersion(3); fmt.setMinorVersion(2); QSurfaceFormat::setDefaultFormat(fmt); + + QOpenGLContext glContext; + fmt = glContext.format(); + if (fmt.majorVersion() < 3) { + printf("Could not get OpenGL 3.0 context. Aborting.\n"); + log_abort(); + } + if (fmt.minorVersion() < 2) { + printf("Could not get OpenGL 3.2 context - trying anyway...\n "); + } + #ifdef _WIN32 SetConsoleCtrlHandler((PHANDLER_ROUTINE)WinHandler, TRUE); #endif -- cgit v1.2.3