Play-/Source/ui_qt/openglwindow.cpp
Jean-Philip Desjardins 0fac36935e Disable vsync on desktop OpenGL.
Should make this a setting toggle.
2021-12-15 17:42:57 -05:00

23 lines
528 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.setSwapInterval(0);
format.setAlphaBufferSize(0);
return format;
}