1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 06:43:22 +02:00

Large areas (polygons) require a stencil buffer when drawn using OpenGL

This commit is contained in:
Martin Tůma 2019-04-15 22:14:59 +02:00
parent 4daa9fd55c
commit 82923a4529
2 changed files with 6 additions and 4 deletions

View File

@ -51,7 +51,7 @@ App::App(int &argc, char **argv) : QApplication(argc, argv)
"QThreadStorage: Thread X exited after QThreadStorage Y destroyed" */ "QThreadStorage: Thread X exited after QThreadStorage Y destroyed" */
Downloader::setNetworkManager(new QNetworkAccessManager(this)); Downloader::setNetworkManager(new QNetworkAccessManager(this));
DEM::setDir(ProgramPaths::demDir()); DEM::setDir(ProgramPaths::demDir());
OPENGL_SET_SAMPLES(4); OPENGL_SET_FORMAT(4, 8);
loadDatums(); loadDatums();
loadPCSs(); loadPCSs();

View File

@ -14,13 +14,15 @@
#endif #endif
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
#define OPENGL_SET_SAMPLES(samples) \ #define OPENGL_SET_FORMAT(samples, stencilBuffer) \
{QGLFormat fmt; \ {QGLFormat fmt; \
fmt.setStencilBufferSize(stencilBuffer); \
fmt.setSamples(samples); \ fmt.setSamples(samples); \
QGLFormat::setDefaultFormat(fmt);} QGLFormat::setDefaultFormat(fmt);}
#else #else
#define OPENGL_SET_SAMPLES(samples) \ #define OPENGL_SET_FORMAT(samples, stencilBuffer) \
{QSurfaceFormat fmt; \ {QSurfaceFormat fmt; \
fmt.setSamples(samples);\ fmt.setStencilBufferSize(stencilBuffer); \
fmt.setSamples(samples); \
QSurfaceFormat::setDefaultFormat(fmt);} QSurfaceFormat::setDefaultFormat(fmt);}
#endif #endif