mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-30 04:50:08 +00:00
1875a03757
While also ensuring proper OpenGL resource destruction.
27 lines
691 B
C++
27 lines
691 B
C++
#include "mainwindow.h"
|
|
|
|
#include <QApplication>
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
// "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);
|
|
|
|
// TODO: something with QCommandLineParser to accept a file to launch.
|
|
|
|
QApplication a(argc, argv);
|
|
|
|
MainWindow *w = new MainWindow();
|
|
w->setAttribute(Qt::WA_DeleteOnClose);
|
|
w->show();
|
|
|
|
return a.exec();
|
|
}
|