Can not set renderable type from OpenGLES to OpenGL in Qt 5.7.0
-
wrote on 28 Oct 2016, 14:21 last edited by pvt.peter
Hi,
I have worked on a project which used Qt 5.4.1 with OpenGL, here is the installer which i installed earlier:
qt-opensource-windows-x86-msvc2013_opengl-5.4.1.exeAfter, we have done an upgrade from Qt 5.4.1 to Qt 5.7.0, so i installed this package:
qt-opensource-windows-x86-msvc2013-5.7.0.exeOn this project, we use OpenGL shared context too, which is works perfectly under Qt 5.4.1.
After upgade to Qt 5.7.0, we got unexpected errors.The main problem is: i can not set individual QSurfaceFormat for QOpenGLContext. I would like to use OpenGL as RenderableType.
So, i create a QSurfaceFormat, and passed to to QOpenGLContext::setFormat().QSurfaceFormat format; format.setVersion(2, 0); // OpenGL 2.0 format.setProfile(QSurfaceFormat::CoreProfile); format.setRenderableType(QSurfaceFormat::RenderableType::OpenGL); QOpenGLContext *shareContext = QOpenGLContext::globalShareContext(); shareContext->isOpenGLES(); // true shareContext->format().version(); // QPair(2,0) -> OpenGL 2.0 shareContext->format().renderableType(); // 2 -> QSurfaceFormat::RenderableType::OpenGLES shareContext->setFormat(glFormat); shareContext->create(); shareContext->isOpenGLES(); // true shareContext->format().version(); // QPair(2,0) -> OpenGL 2.0 shareContext->format().renderableType(); // 2 -> QSurfaceFormat::RenderableType::OpenGLES
What is the problem?
It is like, there is a global setting to RenderableType as OpenGLES.
How can i set to OpenGL?Thanks in advance,
Peter -
Hi,
Since 5.5 the backend selection is dynamic. You can however influence its behavior. See here for more information.
-
Hi,
Since 5.5 the backend selection is dynamic. You can however influence its behavior. See here for more information.
-
Good !
Then please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)
1/4