This may not be the best way but what you could try to do is create an OpenGL context using a fake, high version and then check what was actually created.
In QOpenGLContext’s docs:
“If the OpenGL implementation on your system does not support the requested version of OpenGL context, then QOpenGLContext will try to create the closest matching version.”
Example:
QSurfaceFormat requestedFormat;
requestedFormat.setVersion( 99, 99 );
QOpenGLContext* context = new QOpenGLContext;
context->setFormat( requestedFormat );
context->create();
qDebug() << QString("Requested OpenGL version (%1.%2); Actual created version (%3.%4).").arg(requestedFormat.majorVersion()).arg(requestedFormat.minorVersion()).arg(context->format().majorVersion()).arg(context->format().minorVersion());
↧