mirror of
https://github.com/YosysHQ/nextpnr.git
synced 2026-04-26 04:07:02 +00:00
Bring back check that GL contexts get the format requested.
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "application.h"
|
||||
#include "log.h"
|
||||
#include <QOpenGLContext>
|
||||
#include <QMessageBox>
|
||||
#include <QSurfaceFormat>
|
||||
#include <QTextStream>
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user