2016-07-01 05:21:58 +03:00
|
|
|
#include "openglwindow.h"
|
|
|
|
|
2018-04-30 21:01:23 +01:00
|
|
|
OpenGLWindow::OpenGLWindow(QWindow* parent)
|
2019-09-12 15:11:52 -04:00
|
|
|
: OutputWindow(parent)
|
2016-07-01 05:21:58 +03:00
|
|
|
{
|
2020-02-02 19:21:22 +00:00
|
|
|
|
|
|
|
setSurfaceType(QWindow::OpenGLSurface);
|
|
|
|
setFormat(GetSurfaceFormat());
|
|
|
|
}
|
|
|
|
|
|
|
|
QSurfaceFormat OpenGLWindow::GetSurfaceFormat()
|
|
|
|
{
|
2020-02-06 12:39:36 +00:00
|
|
|
QSurfaceFormat format;
|
2019-10-23 12:32:32 +01:00
|
|
|
#if defined(GLES_COMPATIBILITY)
|
|
|
|
format.setVersion(3, 0);
|
|
|
|
#else
|
2018-04-30 21:01:23 +01:00
|
|
|
format.setVersion(3, 2);
|
2019-10-23 12:32:32 +01:00
|
|
|
#endif
|
2018-04-30 21:01:23 +01:00
|
|
|
format.setProfile(QSurfaceFormat::CoreProfile);
|
|
|
|
format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
|
2016-07-01 05:21:58 +03:00
|
|
|
|
2020-02-02 19:21:22 +00:00
|
|
|
return format;
|
2017-04-22 19:46:31 +01:00
|
|
|
}
|