History

Warn user if OpenGL version is too low (< 4.1)

David Rowe committed 10 years ago

Commit af3d8421 parent 7b5c2213 files · +98 −0Browse files

Showing the changes to interface/src/main.cpp (1 of 3 files). Show all

Unified · Split

interface/src/main.cpp+13−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include "AddressManager.h"
2323 #include "Application.h"
2424 #include "InterfaceLogging.h"
25+#include "OpenGLInfo.h"
2526 #include "MainWindow.h"
2627
2728 int main(int argc, const char* argv[]) {
@@ -83,6 +84,17 @@ int main(int argc, const char* argv[]) { · 55 unmodified lines
8384 #endif
8485 }
8586
87+ // Check OpenGL version.
88+ // This is done separately from the main Application so that start-up and shut-down logic within the main Application is
89+ // not made more complicated than it already is.
90+ {
91+ OpenGLInfo openGLInfo(argc, const_cast<char**>(argv));
92+ if (!openGLInfo.isValidVersion()) {
93+ qCDebug(interfaceapp, "Early exit due to OpenGL version.");
94+ return 0;
95+ }
96+ }
97+
8698 QElapsedTimer startupTime;
8799 startupTime.start();
88100
@@ -96,6 +108,7 @@ int main(int argc, const char* argv[]) { · 7 unmodified lines
96108 usecTimestampNowForceClockSkew(clockSkew);
97109 qCDebug(interfaceapp, "clockSkewOption=%s clockSkew=%d", clockSkewOption, clockSkew);
98110 }
111+
99112 // Oculus initialization MUST PRECEDE OpenGL context creation.
100113 // The nature of the Application constructor means this has to be either here,
101114 // or in the main window ctor, before GL startup.