OpenGL: Make use of the requested version and profile in QGLWidget
When instatiating a QGLWidget in Qt5 at present it ignores the version and profile information in the QGLFormat meaning that we always end up with an OpenGL 2.x profile rather than what we asked for. This commit properly takes the version and profile into account. Change-Id: I097f10e397c23f5d97c5fcd8d5354667da286896 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>bb10
parent
c45005a778
commit
77fc6d30f1
|
|
@ -104,6 +104,9 @@ QSurfaceFormat QGLFormat::toSurfaceFormat(const QGLFormat &format)
|
|||
if (format.stencil())
|
||||
retFormat.setStencilBufferSize(format.stencilBufferSize() == -1 ? 1 : format.stencilBufferSize());
|
||||
retFormat.setStereo(format.stereo());
|
||||
retFormat.setMajorVersion(format.majorVersion());
|
||||
retFormat.setMinorVersion(format.minorVersion());
|
||||
retFormat.setProfile(static_cast<QSurfaceFormat::OpenGLContextProfile>(format.profile()));
|
||||
return retFormat;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue