Backported from 308f2cb8ea
308f2cb8ea
Still some things to sort out, but seems to work. A lot of variables and calls had to be made non-static.
Hopefully this will lead the way to adding support for things like Wayland and Haiku graphics, cf. #56. We define a display_output_base class that display backends can derive from to implement display-specific calls.