2016-12-20 00:11:30 +01:00
|
|
|
#include <QtGlobal>
|
2018-07-24 18:00:40 +02:00
|
|
|
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
|
2016-12-20 00:11:30 +01:00
|
|
|
#include <QGLWidget>
|
|
|
|
#include <QGLFormat>
|
|
|
|
#else
|
|
|
|
#include <QOpenGLWidget>
|
|
|
|
#include <QSurfaceFormat>
|
|
|
|
#endif
|
|
|
|
|
2018-07-24 18:00:40 +02:00
|
|
|
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
|
2016-12-20 00:11:30 +01:00
|
|
|
#define OPENGL_WIDGET QGLWidget
|
|
|
|
#else
|
|
|
|
#define OPENGL_WIDGET QOpenGLWidget
|
|
|
|
#endif
|
|
|
|
|
2018-07-24 18:00:40 +02:00
|
|
|
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
|
2016-12-20 00:11:30 +01:00
|
|
|
#define OPENGL_SET_SAMPLES(samples) \
|
|
|
|
{QGLFormat fmt; \
|
|
|
|
fmt.setSamples(samples); \
|
|
|
|
QGLFormat::setDefaultFormat(fmt);}
|
|
|
|
#else
|
|
|
|
#define OPENGL_SET_SAMPLES(samples) \
|
|
|
|
{QSurfaceFormat fmt; \
|
|
|
|
fmt.setSamples(samples);\
|
|
|
|
QSurfaceFormat::setDefaultFormat(fmt);}
|
|
|
|
#endif
|