2021-09-03 16:56:57 +00:00
|
|
|
/*##############################################################################
|
|
|
|
## Author: Shaun Reed ##
|
2022-03-07 13:20:32 +00:00
|
|
|
## Legal: All Content (c) 2022 Shaun Reed, all rights reserved ##
|
|
|
|
## About: Main program for practice using Qt6 widgets and OpenGL ##
|
2021-09-03 16:56:57 +00:00
|
|
|
## ##
|
|
|
|
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
|
|
|
##############################################################################*/
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QLabel>
|
|
|
|
|
2022-08-21 19:37:42 +00:00
|
|
|
#include <qtkwidget.h>
|
2022-03-13 22:00:00 +00:00
|
|
|
#include <mainwindow.h>
|
2021-09-03 16:56:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QApplication a(argc, argv);
|
|
|
|
|
|
|
|
// Set OpenGL Version information
|
|
|
|
// Note: This format must be set before show() is called.
|
|
|
|
QSurfaceFormat format;
|
|
|
|
format.setRenderableType(QSurfaceFormat::OpenGL);
|
|
|
|
format.setProfile(QSurfaceFormat::CoreProfile);
|
|
|
|
format.setVersion(4,5);
|
|
|
|
// Set the number of samples used for glEnable(GL_MULTISAMPLING)
|
|
|
|
format.setSamples(4);
|
2022-03-13 22:00:00 +00:00
|
|
|
// Set the size of the depth bufer for glEnable(GL_DEPTH_TEST)
|
2021-09-03 16:56:57 +00:00
|
|
|
format.setDepthBufferSize(16);
|
|
|
|
#ifdef QTK_DEBUG
|
|
|
|
format.setOption(QSurfaceFormat::DebugContext);
|
|
|
|
#endif // QTK_DEBUG
|
|
|
|
|
2022-03-13 22:00:00 +00:00
|
|
|
// Create window for Qt application using custom mainwindow.h
|
|
|
|
MainWindow w;
|
|
|
|
w.show();
|
2021-09-03 16:56:57 +00:00
|
|
|
|
|
|
|
return a.exec();
|
|
|
|
}
|
|
|
|
|