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