mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-10 22:38:34 +02:00
Initialize the GL widget with the 4.1 core profile
This commit is contained in:
parent
d9d0f8dcfd
commit
1e44495f7c
1 changed files with 16 additions and 1 deletions
|
@ -19,7 +19,22 @@
|
||||||
|
|
||||||
const int MSECS_PER_FRAME_WHEN_THROTTLED = 66;
|
const int MSECS_PER_FRAME_WHEN_THROTTLED = 66;
|
||||||
|
|
||||||
GLCanvas::GLCanvas() : QGLWidget(QGL::NoDepthBuffer | QGL::NoStencilBuffer),
|
static QGLFormat& getDesiredGLFormat() {
|
||||||
|
// Specify an OpenGL 3.3 format using the Core profile.
|
||||||
|
// That is, no old-school fixed pipeline functionality
|
||||||
|
static QGLFormat glFormat;
|
||||||
|
static std::once_flag once;
|
||||||
|
std::call_once(once, [] {
|
||||||
|
glFormat.setVersion(4, 1);
|
||||||
|
glFormat.setProfile(QGLFormat::CoreProfile); // Requires >=Qt-4.8.0
|
||||||
|
glFormat.setSampleBuffers(false);
|
||||||
|
glFormat.setDepth(false);
|
||||||
|
glFormat.setStencil(false);
|
||||||
|
});
|
||||||
|
return glFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
GLCanvas::GLCanvas() : QGLWidget(getDesiredGLFormat()),
|
||||||
_throttleRendering(false),
|
_throttleRendering(false),
|
||||||
_idleRenderInterval(MSECS_PER_FRAME_WHEN_THROTTLED)
|
_idleRenderInterval(MSECS_PER_FRAME_WHEN_THROTTLED)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue