Showing the changes to interface/src/main.cpp (1 of 3 files). Show all
Unified · Split
| @@ -22,6 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | #include "AddressManager.h" |
| 23 | 23 | #include "Application.h" |
| 24 | 24 | #include "InterfaceLogging.h" |
| 25 | +#include "OpenGLInfo.h" | |
| 25 | 26 | #include "MainWindow.h" |
| 26 | 27 | |
| 27 | 28 | int main(int argc, const char* argv[]) { |
| @@ -83,6 +84,17 @@ int main(int argc, const char* argv[]) { · 55 unmodified lines | ||
| 83 | 84 | #endif |
| 84 | 85 | } |
| 85 | 86 | |
| 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 | + | |
| 86 | 98 | QElapsedTimer startupTime; |
| 87 | 99 | startupTime.start(); |
| 88 | 100 | |
| @@ -96,6 +108,7 @@ int main(int argc, const char* argv[]) { · 7 unmodified lines | ||
| 96 | 108 | usecTimestampNowForceClockSkew(clockSkew); |
| 97 | 109 | qCDebug(interfaceapp, "clockSkewOption=%s clockSkew=%d", clockSkewOption, clockSkew); |
| 98 | 110 | } |
| 111 | + | |
| 99 | 112 | // Oculus initialization MUST PRECEDE OpenGL context creation. |
| 100 | 113 | // The nature of the Application constructor means this has to be either here, |
| 101 | 114 | // or in the main window ctor, before GL startup. |