Handling GLXBadFBConfig gracefully
Hello,
it seems that the whole world is constantly having issues with GLXBadFBConfig error which aborts the program in GLX_ARB_create_context, when one requests e.g. a too recent context:
- https://bugreports.qt.io/browse/QTBUG-100787
- https://community.khronos.org/t/x-error-of-failed-request-glxbadfbconfig/71023/3
- https://forum.winehq.org/viewtopic.php?f=8&t=34889
- https://www.reddit.com/r/linux_gaming/comments/mfw36e/x_error_of_failed_request_glxbadfbconfig_after/
- etc etc..
The problem is that creating a context is in general the only reliable way to make sure of what the driver supports (parsing gl driver strings is definitely not, and you don't even have a context to call glGetString
on anyways !).
Probing contexts from the most recent to least recent version is then guaranteed to crash on GLX because of this. What are the solutions to make sure that one can e.g. try a GL X.Y context, and progressively fall back to X.Y-N without making the app just crash on GLX_ARB_create_context ?