Bring back check that GL contexts get the format requested.
This commit is contained in:
parent
7f950a1852
commit
d00288198f
@ -20,6 +20,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
|
#include "log.h"
|
||||||
|
#include <QOpenGLContext>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSurfaceFormat>
|
#include <QSurfaceFormat>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
@ -47,6 +49,17 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
fmt.setMajorVersion(3);
|
fmt.setMajorVersion(3);
|
||||||
fmt.setMinorVersion(2);
|
fmt.setMinorVersion(2);
|
||||||
QSurfaceFormat::setDefaultFormat(fmt);
|
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
|
#ifdef _WIN32
|
||||||
SetConsoleCtrlHandler((PHANDLER_ROUTINE)WinHandler, TRUE);
|
SetConsoleCtrlHandler((PHANDLER_ROUTINE)WinHandler, TRUE);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user