I set a QSurfaceFormat
on my window, and this surface format has "3.0" set as its GL version number. The code:
static QSurfaceFormat createSurfaceFormat() {
QSurfaceFormat format;
format.setSamples(4);
format.setDepthBufferSize(24);
format.setStencilBufferSize(8);
format.setVersion(3, 0);
return format;
}
int main(int argc, char *argv[]) {
// ...
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
QWindow* window = (QWindow*) engine.rootObjects().first();
window->setFormat(::createSurfaceFormat());
// ...
}
Also, in main()
I enable OpenGL ES mode, like this:
QGuiApplication::setAttribute(Qt::AA_UseOpenGLES);
This means I'm requesting a GL ES 3.0 context.
The ANGLE docs say (in a table near the beginning) that GL ES 3.0 -> D3D 11
API translation support is implemented. And my system supports D3D 11 according to dxdiag.exe
.
But when I launch my app, which contains this QML code...
Text {
text: OpenGLInfo.majorVersion + "." + OpenGLInfo.minorVersion
}
... I see "2.0" is displayed. Also, using the method I described here, I've determined that the maximal supported shading language version on my PC is "100" aka 1.0.
At the same time, from this Qt blog post I know that Qt supports GL ES 3.0 apps.
So why can't I use OpenGL ES 3.0 in Qt?