Play-/Source/ui_qt/openglwindow.cpp
Jean-Philip Desjardins 3fcf2b58cb Set alpha buffer size.
Otherwise, we get a transparent surface on macOS.
2021-01-08 17:46:45 -05:00

22 lines
500 B
C++

#include "openglwindow.h"
OpenGLWindow::OpenGLWindow(QWindow* parent)
: OutputWindow(parent)
{
setSurfaceType(QWindow::OpenGLSurface);
setFormat(GetSurfaceFormat());
}
QSurfaceFormat OpenGLWindow::GetSurfaceFormat()
{
QSurfaceFormat format;
#if defined(GLES_COMPATIBILITY)
format.setVersion(3, 0);
#else
format.setVersion(3, 2);
#endif
format.setProfile(QSurfaceFormat::CoreProfile);
format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
format.setAlphaBufferSize(0);
return format;
}