I’ll link to my code here once I write it! I have a Librem 5.
Isn’t your PortableGL a software renderer? If so, you can directly create a pixel buffer from Wayland.
When I was writing a keyboard for the Librem 5 I made this file which will be what I base the game’s Wayland code off of. At the very bottom of the file it shows a nice workflow thing, which is generating the headers from the protocol XML as part of the Cakelisp build process.
I will be using Cakelisp, but because it transpiles to C I can share the transpiled results for others to use. I will of course be using some 3rd party C headers/libraries as well. I usually reach for SDL2 but lately I’ve wanted to move away from it for startup performance, reduction of dependencies (my holy grail is a 100% static linked 3D accelerated application), and for learning purposes.