Cross-platform error handling when the graphics API cannot be initialized

Apparently, this issue has been brought up before:

I want a convenient way of displaying a message like

“Failed to initialize the rendering backend. Possible issues include a missing or outdated video driver, or a too old video card. Try to reinstall the appropriate video driver and restart the computer.”

This is can be done

  • By relying on using the native windowing API (X11, Wayland, Windows API, …), which requires detecting the current platform, and select the correct strategy.

  • Communicating with another process, implemented using a GUI toolkit that does not require hardware acceleration (GTK, Qt, WxWidgets, …). This adds additional dependencies to the project.

Any sane option?

You could use something like:

This still adds GTK as a project dependency.