GTK uses libepoxy, so you can use the libepoxy API, like epoxy_has_glx()
, epoxy_has_egl()
, etc.
In general, GTK will create GLX contexts under X11, and EGL contexts under Wayland.
Use libepoxy.
To be fair, though, I have no idea what you’re trying to achieve. You should not ever know what kind of underlying windowing system API created a GL context; if you want to check for windowing system-specific extensions, you can use epoxy_has_glx_extension()
, epoxy_has_egl_extension()
, or epoxy_has_wgl_extension()
before using them, just like you’d use epoxy_has_gl_extension()
.