diff --git a/CMakeLists.txt b/CMakeLists.txt index ab3da749..e48f48d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.12) set(Easy3D_VERSION_MAJOR 2) set(Easy3D_VERSION_MINOR 5) -set(Easy3D_VERSION_PATCH 3) +set(Easy3D_VERSION_PATCH 4) set(Easy3D_VERSION_STRING ${Easy3D_VERSION_MAJOR}.${Easy3D_VERSION_MINOR}.${Easy3D_VERSION_PATCH}) set(Easy3D_VERSION_NUMBER 10${Easy3D_VERSION_MAJOR}0${Easy3D_VERSION_MINOR}0${Easy3D_VERSION_PATCH}) diff --git a/applications/Mapple/main.cpp b/applications/Mapple/main.cpp index a70ec5c0..f04d3ff7 100644 --- a/applications/Mapple/main.cpp +++ b/applications/Mapple/main.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -111,6 +112,7 @@ int main(int argc, char *argv[]) { format.setProfile(QSurfaceFormat::CoreProfile); format.setDepthBufferSize(24); format.setStencilBufferSize(8); + format.setSwapBehavior(QSurfaceFormat::DoubleBuffer); format.setSamples(4); #ifndef NDEBUG format.setOption(QSurfaceFormat::DebugContext); @@ -122,26 +124,19 @@ int main(int argc, char *argv[]) { QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) +#if (defined(Q_OS_WIN) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif -#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) - //QApplication::setAttribute(Qt::AA_DontUseNativeDialogs); -#endif - -#ifdef __APPLE__ - //QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar); -#endif Mapple app(argc, argv); -#ifndef __APPLE__ - // to have similar style on different platforms (macOS. +#ifndef Q_OS_MAC + // to have similar style on different platforms (macOS) app.setStyle(QStyleFactory::create("Fusion")); #endif QDir workingDir = QCoreApplication::applicationDirPath(); -#ifdef __APPLE__ +#ifdef Q_OS_MAC // This makes sure that our "working directory" is not within the application bundle if (workingDir.dirName() == "MacOS") { workingDir.cdUp(); @@ -169,6 +164,15 @@ int main(int argc, char *argv[]) { } #endif + if (!QGLFormat::hasOpenGL()) { + LOG(ERROR) << "Mapple needs OpenGL to run"; + return EXIT_FAILURE; + } + if ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_3_2) == 0) { + LOG(ERROR) << "Mapple needs OpenGL 3.2 at least to run"; + return EXIT_FAILURE; + } + try { MainWindow win; if (!logging::log_file().empty()) diff --git a/applications/Mapple/main_window.cpp b/applications/Mapple/main_window.cpp index 3ef8dc20..92ca58d8 100644 --- a/applications/Mapple/main_window.cpp +++ b/applications/Mapple/main_window.cpp @@ -867,7 +867,7 @@ void MainWindow::onAbout() title += QMessageBox::tr("

Mapple (%1 bit)

").arg(bits); #endif - title += QMessageBox::tr("

based on Easy3D v%1 (%2) and Qt v%3

").arg(EASY3D_VERSION_STR).arg(EASY3D_RELEASE_DATE).arg(QT_VERSION_STR); + title += QMessageBox::tr("

based on Easy3D v%1 (%2) and Qt v%3

").arg(EASY3D_VERSION_STR).arg(EASY3D_RELEASE_DATE).arg(QT_VERSION_STR); // __DATE__ QString text = QMessageBox::tr( "

Mapple is software for processing and rendering 3D data (e.g., point clouds, graphs, surface meshes, " diff --git a/easy3d/util/version.h b/easy3d/util/version.h index 9eee0898..c0632e99 100644 --- a/easy3d/util/version.h +++ b/easy3d/util/version.h @@ -56,10 +56,10 @@ namespace easy3d { #define EASY3D_VERSION_STR Easy3D_VERSION_STRING /// Easy3D version number, in the format 10[MAJOR]0[MINOR]0[PATCH]. -#define EASY3D_VERSION_NR 1020503 +#define EASY3D_VERSION_NR 1020504 /// Easy3D release date, in the format YYYYMMDD. -#define EASY3D_RELEASE_DATE 20240916 +#define EASY3D_RELEASE_DATE 20240926 #endif // EASY3D_UTIL_VERSION_H