How to check OpenGL version?
-
Hello, I have program build with qml controls 2. Minimum PC requirements to run this program are Windows Vista (I think) and OpenGL 2.0 (controls 2 need that). People which have lower OpenGL version still sometimes can open program, but it opens incorectly(empty screen is visible with app frame). How to prevent that? How to check OpenGL version after program starts and show error message? I read somewehre that: The only way to know if your OpenGL implementation supports a particular version is to attempt to create a context with that version and see if you get a valid context as a result
-
@Aronax said in How to check OpenGL version?:
How to check OpenGL version after program starts and show error message?
See the top answer at https://stackoverflow.com/questions/15960463/programatically-determine-if-opengl-function-is-supported-by-hardware
-
@Aronax said in How to check OpenGL version?:
Are there any QT functions to do that? I just want to point out, that I am not using OpenGL by my selft programmatically. I just simply use Qt Quick Controls 2.
AFAIK, there is no function in Qt to give you the OpenGL version.
I've never tried this, but you could play around with
QOpenGLFunctions
and see if you can deduce the version by calling its functions (maybe some feature is not available in OpenGL <2.0, or maybe some function calls will fail): https://doc.qt.io/qt-5/qopenglfunctions.html#openGLFeatures