Play-/Source/ui_qt/openglwindow.cpp

23 lines
500 B
C++
Raw Normal View History

2016-07-01 05:21:58 +03:00
#include "openglwindow.h"
2018-04-30 21:01:23 +01:00
OpenGLWindow::OpenGLWindow(QWindow* parent)
: OutputWindow(parent)
2016-07-01 05:21:58 +03: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);
format.setAlphaBufferSize(0);
return format;
2017-04-22 19:46:31 +01:00
}