diff --git a/src/GUI/app.cpp b/src/GUI/app.cpp index 94f0fe0a..7fdb5dce 100644 --- a/src/GUI/app.cpp +++ b/src/GUI/app.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #ifdef Q_OS_ANDROID @@ -58,10 +57,6 @@ App::App(int &argc, char **argv) : QApplication(argc, argv) "QThreadStorage: Thread X exited after QThreadStorage Y destroyed" */ Downloader::setNetworkManager(new QNetworkAccessManager(this)); DEM::setDir(ProgramPaths::demDir()); - QSurfaceFormat fmt; - fmt.setStencilBufferSize(8); - fmt.setSamples(4); - QSurfaceFormat::setDefaultFormat(fmt); #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QImageReader::setAllocationLimit(0); #endif // QT6 diff --git a/src/main.cpp b/src/main.cpp index d0067146..0bfce86a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,5 @@ +#include +#include #include "GUI/app.h" #include "GUI/timezoneinfo.h" @@ -12,6 +14,19 @@ int main(int argc, char *argv[]) qRegisterMetaType("TimeZoneInfo"); #endif // QT6 + QSurfaceFormat fmt; + fmt.setProfile(QSurfaceFormat::CoreProfile); +#ifdef Q_OS_ANDROID + fmt.setRenderableType(QSurfaceFormat::OpenGLES); +#else // Android + fmt.setVersion(3, 2); + fmt.setRenderableType(QSurfaceFormat::OpenGL); +#endif // Android + fmt.setDepthBufferSize(24); + fmt.setStencilBufferSize(8); + fmt.setSamples(4); + QSurfaceFormat::setDefaultFormat(fmt); + App app(argc, argv); return app.run(); }