Very cool! What would the "gui-version" of this look like? Would you write it once with linux bindings and the executable would succesfully create a window in every operating system?
I think it'd be pretty sweet to have a basically an APE approach to having a blank GPU framebuffer canvas, and let high level libraries do the rest. Other folks on my team have been floating the idea of getting X to build as an APE binary. Who knows what the future holds? We don't have any resources devoted however to the problem at the moment.
Oh man, something like that would be wonderful for indie games. Targeting multiple platforms is a lot of work for a hobbyist game developer, especially if you're not using a full-on engine like Unity or Godot.