2020-05-30 04:37:06 +00:00
|
|
|
#include "mainwindow.h"
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2020-06-04 03:39:16 +00:00
|
|
|
// "Calling QSurfaceFormat::setDefaultFormat() before constructing the
|
|
|
|
// QApplication instance is mandatory on some platforms ... when an
|
|
|
|
// OpenGL core profile context is requested."
|
|
|
|
QSurfaceFormat format;
|
|
|
|
format.setVersion(3, 2);
|
|
|
|
format.setProfile(QSurfaceFormat::CoreProfile);
|
|
|
|
format.setDepthBufferSize(0);
|
|
|
|
format.setStencilBufferSize(0);
|
|
|
|
QSurfaceFormat::setDefaultFormat(format);
|
|
|
|
|
2020-06-01 03:39:08 +00:00
|
|
|
QApplication a(argc, argv);
|
2020-07-14 01:51:55 +00:00
|
|
|
MainWindow *const w = (argc > 1) ? new MainWindow(argv[1]) : new MainWindow();
|
2020-06-23 00:32:44 +00:00
|
|
|
w->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
w->show();
|
|
|
|
|
2020-06-01 03:39:08 +00:00
|
|
|
return a.exec();
|
2020-05-30 04:37:06 +00:00
|
|
|
}
|