36 lines
1.0 KiB
C++
Raw Permalink Normal View History

2026-01-16 01:04:43 +08:00
#include <QApplication>
#include <QSurfaceFormat>
#include <QIcon>
#include "CloudViewMainWindow.h"
#define APP_VERSION "1.0.2"
2026-01-16 01:04:43 +08:00
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
// 设置 OpenGL 格式 - 使用 2.1 版本以确保固定管线兼容
QSurfaceFormat format;
format.setDepthBufferSize(24);
format.setStencilBufferSize(8);
format.setVersion(2, 1); // 使用 OpenGL 2.1 以确保固定管线函数可用
format.setSamples(4); // 抗锯齿
QSurfaceFormat::setDefaultFormat(format);
// 设置应用信息
app.setApplicationName("CloudView");
app.setOrganizationName("CloudView");
app.setApplicationVersion(APP_VERSION);
2026-01-16 01:04:43 +08:00
// 设置应用程序图标
app.setWindowIcon(QIcon(":/logo.png"));
// 创建并显示主窗口
CloudViewMainWindow mainWindow;
mainWindow.setWindowTitle(QString("点云查看器 v%1").arg(APP_VERSION));
2026-01-16 01:04:43 +08:00
mainWindow.resize(1280, 720);
mainWindow.show();
return app.exec();
}