Hello.
For Windows and his GDI you may take a look at source of fpGUI or MSEgui project.
But for unixes (Linux, BSD and Mac), they use the "root" X11 interface without any dependencies to any widgetset.
... but in this Wayland future, X might be an additional dependency in the near future.
Sincerely, I hope Wayland will not be the future.
Wayland is pushed by RedHat + IBM, is obsolete, brings little more than X11 but above all removes a lot of cool things.
Wayland destroys the soul of the "free-desktop".
https://gist.github.com/probonopd/9feb7c20257af5dd915e3a9f2d1f2277At the limit I prefer the option of OpenBSD which decided to continue the development of X11 and libx11.so.7, with the pluses that XWayland offers without the minuses that Wayland imposes.