Detect OpenGL version before creating QApplication?
-
Platform: Windows 10
Qt: 5.12.10I just had to fix a stupid bug in my app that was causing it to not draw things correctly on a customer's computer. It turns out they by policy only have drivers for Vulkan and DirectX on their Windows 10 machines. They had absolutely zero drivers for opengl. So the application was starting and using Microsoft's opengl 1.1. QML requires a minimum of opengl 2.1 last I checked. So I forced the app to use ANGLE at the start. I also added command line options to choose opengl if needed. (In case someone somewhere doesn't have directx 9/11 installed. )
Why would Qt select a version of opengl that doesn't meet minimum requirements? Shouldn't it default to angle in this case?
I will have to research this a bit. Maybe 5.15 fixes this issue. I am not readily seeing a way to check opengl version either.
-
Platform: Windows 10
Qt: 5.12.10I just had to fix a stupid bug in my app that was causing it to not draw things correctly on a customer's computer. It turns out they by policy only have drivers for Vulkan and DirectX on their Windows 10 machines. They had absolutely zero drivers for opengl. So the application was starting and using Microsoft's opengl 1.1. QML requires a minimum of opengl 2.1 last I checked. So I forced the app to use ANGLE at the start. I also added command line options to choose opengl if needed. (In case someone somewhere doesn't have directx 9/11 installed. )
Why would Qt select a version of opengl that doesn't meet minimum requirements? Shouldn't it default to angle in this case?
I will have to research this a bit. Maybe 5.15 fixes this issue. I am not readily seeing a way to check opengl version either.
-
@DerReisende said in Detect OpenGL version before creating QApplication?:
glGetString
This led me to this topic:
https://forum.qt.io/topic/64503/qopenglfunctions-glgetstring-gl_extensions-is-null/16I ended up creating the QApplication, a surface, and a context. Then I check the version. Then I delete the app and the surface and force the attribute to use ANGLE if the opengl version is too low (<2.1). Then I recreate the QApplication.